Changeset 21969a4a in sasview
- Timestamp:
- Mar 29, 2011 4:52:25 PM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 8f12385
- Parents:
- 3b72b36
- Location:
- guiframe
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/AnnulusSlicer.py
r55a0dc1 r21969a4a 160 160 # If the data file does not tell us what the axes are, just assume... 161 161 new_plot.xaxis("\\rm{\phi}", 'degrees') 162 new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 162 if hasattr(data, "scale"): 163 if data.scale == 'linear': 164 new_plot.ytransform = 'y' 165 new_plot.yaxis("\\rm{Residuals} ", "/") 166 else: 167 new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 168 163 169 new_plot.group_id = "AnnulusPhi" + self.base.data2D.name 164 new_plot.id = "AnnulusPhi" + self.base.data2D.name170 new_plot.id = None 165 171 #new_plot.is_data= True 166 172 new_plot.xtransform = "x" -
guiframe/local_perspectives/plotting/SectorSlicer.py
r55a0dc1 r21969a4a 167 167 else: 168 168 dxw = None 169 new_plot = Data1D(x=sector.x, y=sector.y, dy=sector.dy )169 new_plot = Data1D(x=sector.x, y=sector.y, dy=sector.dy, dx=sector.dx) 170 170 new_plot.dxl = dxl 171 171 new_plot.dxw = dxw … … 175 175 new_plot.interactive = True 176 176 new_plot.detector = self.base.data2D.detector 177 # If the data file does not tell us what the axes are, just assume... 178 new_plot.xaxis("\\rm{Q}", 'A^{-1}') 179 new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 177 ## If the data file does not tell us what the axes are, just assume... 178 new_plot.xaxis("\\rm{Q}", "A^{-1}") 179 if hasattr(data, "scale"): 180 if data.scale == 'linear': 181 new_plot.ytransform = 'y' 182 new_plot.yaxis("\\rm{Residuals} ", "/") 183 else: 184 new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 185 180 186 new_plot.group_id = "SectorQ" + self.base.data2D.name 181 new_plot.id = "SectorQ" + self.base.data2D.name187 new_plot.id = None 182 188 new_plot.is_data = True 189 183 190 wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot, 184 191 title="SectorQ" + self.base.data2D.name)) -
guiframe/local_perspectives/plotting/boxSlicer.py
r55a0dc1 r21969a4a 188 188 new_plot.interactive = True 189 189 new_plot.detector = self.base.data2D.detector 190 # If the data file does not tell us what the axes are, just assume... 191 new_plot.xaxis("\\rm{Q}", '\\AA^{-1}') 192 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 190 ## If the data file does not tell us what the axes are, just assume... 191 new_plot.xaxis("\\rm{Q}", "A^{-1}") 192 if hasattr(self.base.data2D, "scale"): 193 if self.base.data2D.scale == 'linear': 194 new_plot.ytransform = 'y' 195 new_plot.yaxis("\\rm{Residuals} ", "/") 196 else: 197 new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 193 198 new_plot.group_id = str(self.averager.__name__) + self.base.data2D.name 194 new_plot.id = str(self.averager.__name__)199 #new_plot.id = str(self.averager.__name__) 195 200 #new_plot.is_data= True 196 201 wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot, -
guiframe/local_perspectives/plotting/masking.py
r55a0dc1 r21969a4a 9 9 #following sentence: 10 10 # 11 # "This work benefited from DANSE software developed under NSF award DMR-0520547."11 #This work benefited from DANSE software developed under NSF award DMR-0520547. 12 12 # 13 13 #copyright 2008, University of Tennessee … … 19 19 import sys 20 20 import pylab 21 from pylab import gca22 from pylab import gcf23 21 import math 24 import re25 22 import copy 26 23 import numpy … … 119 116 sizer = wx.GridBagSizer(10, 10) 120 117 #---------inputs---------------- 121 #inputbox = wx.StaticBox(self, -1, "Draw Mask")122 118 shape_txt = wx.StaticText(self, -1, shape) 123 119 sizer.Add(shape_txt, (1, 1), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=5) 124 #innersector_x_txt = wx.StaticText(self, -1, 'Inner Sector')125 120 self.innersector_rb = wx.RadioButton(self, -1, "Double Wings") 126 121 self.Bind(wx.EVT_RADIOBUTTON, self.onInnerSectorMask, … … 128 123 sizer.Add(self.innersector_rb, (2, 1), 129 124 flag=wx.RIGHT|wx.BOTTOM, border=5) 130 #innersector_x_txt = wx.StaticText(self, -1, 'Inner Sector')131 125 self.innercircle_rb = wx.RadioButton(self, -1, "Circular Disk") 132 126 self.Bind(wx.EVT_RADIOBUTTON, self.onInnerRingMask, … … 139 133 id=self.innerbox_rb.GetId()) 140 134 sizer.Add(self.innerbox_rb, (4, 1), flag=wx.RIGHT|wx.BOTTOM, border=5) 141 #outersector_y_txt = wx.StaticText(self, -1, 'Outer Sector') 135 142 136 self.outersector_rb = wx.RadioButton(self, -1, "Double Wing Window") 143 137 self.Bind(wx.EVT_RADIOBUTTON, self.onOuterSectorMask, … … 167 161 168 162 #-----Buttons------------1 169 id = wx.NewId()170 button_add = wx.Button(self, id , "Add")163 id_button = wx.NewId() 164 button_add = wx.Button(self, id_button, "Add") 171 165 button_add.SetToolTipString("Add the mask drawn.") 172 166 button_add.Bind(wx.EVT_BUTTON, self.onAddMask, id=button_add.GetId()) 173 167 sizer.Add(button_add, (13, 7)) 174 id = wx.NewId()175 button_erase = wx.Button(self, id , "Erase")168 id_button = wx.NewId() 169 button_erase = wx.Button(self, id_button, "Erase") 176 170 button_erase.SetToolTipString("Erase the mask drawn.") 177 171 button_erase.Bind(wx.EVT_BUTTON, self.onEraseMask, 178 172 id=button_erase.GetId()) 179 173 sizer.Add(button_erase, (13, 8)) 180 id = wx.NewId()181 button_reset = wx.Button(self, id , "Reset")174 id_button = wx.NewId() 175 button_reset = wx.Button(self, id_button, "Reset") 182 176 button_reset.SetToolTipString("Reset the mask.") 183 177 button_reset.Bind(wx.EVT_BUTTON, self.onResetMask, 184 178 id=button_reset.GetId()) 185 179 sizer.Add(button_reset, (13, 9), flag=wx.RIGHT|wx.BOTTOM, border=15) 186 id = wx.NewId()187 button_reset = wx.Button(self, id , "Clear")180 id_button = wx.NewId() 181 button_reset = wx.Button(self, id_button, "Clear") 188 182 button_reset.SetToolTipString("Clear all mask.") 189 183 button_reset.Bind(wx.EVT_BUTTON, self.onClearMask, … … 270 264 self.onClearSlicer(event) 271 265 self.slicer_z += 1 272 self.slicer = CircularMask(self, self.subplot,266 self.slicer = CircularMask(self, self.subplot, 273 267 zorder=self.slicer_z, side=True) 274 268 self.subplot.set_ylim(self.data.ymin, self.data.ymax) … … 309 303 310 304 :param mask: mask data 311 312 305 """ 313 306 ## Redraw the current image … … 368 361 369 362 :param slicer: slicer class to create 370 371 363 """ 372 364 ## Clear current slicer … … 480 472 def freeze_axes(self): 481 473 """ 474 freeze axes 482 475 """ 483 476 self.plotpanel.axes_frozen = True … … 485 478 def thaw_axes(self): 486 479 """ 480 thaw axes 487 481 """ 488 482 self.plotpanel.axes_frozen = False … … 490 484 def onMouseMotion(self, event): 491 485 """ 486 onMotion event 492 487 """ 493 488 pass … … 495 490 def onWheel(self, event): 496 491 """ 492 on wheel event 497 493 """ 498 494 pass … … 529 525 def add_image(self, plot): 530 526 """ 527 Add Image 531 528 """ 532 529 self.plots[plot.name] = plot … … 554 551 # Slicer plot popup menu 555 552 slicerpop = wx.Menu() 556 #id = wx.NewId() 557 #slicerpop.Append(id,'&Save image', 'Save image as PNG') 558 #wx.EVT_MENU(self, id, self.onSaveImage) 559 560 id = wx.NewId() 561 slicerpop.Append(id, '&Toggle Linear/Log scale') 562 wx.EVT_MENU(self, id, self._onToggleScale) 553 554 id_cm = wx.NewId() 555 slicerpop.Append(id_cm, '&Toggle Linear/Log scale') 556 wx.EVT_MENU(self, id_cm, self._onToggleScale) 563 557 564 558 pos = event.GetPosition() -
guiframe/utils.py
rf444b20 r21969a4a 26 26 return output.lstrip().rstrip() 27 27 if high: 28 output = "%- 6.4g" % value28 output = "%-7.5g" % value 29 29 else: 30 30 output = "%-5.3g" % value
Note: See TracChangeset
for help on using the changeset viewer.