Changeset ffd23b5 in sasview
- Timestamp:
- Jan 19, 2009 11:39:18 AM (16 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:
- 48112ab
- Parents:
- a2c38de
- Location:
- guiframe/local_perspectives/plotting
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/AnnulusSlicer.py
ra2c38de rffd23b5 157 157 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 158 158 new_plot.group_id = "SectorPhi"+self.base.data2D.name 159 159 new_plot.xtransform="x" 160 new_plot.ytransform="y" 160 161 wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot, 161 162 title="SectorPhi" )) -
guiframe/local_perspectives/plotting/Plotter1D.py
rd1dd9d4 rffd23b5 92 92 @param event: data event 93 93 """ 94 94 95 #TODO: Check for existence of plot attribute 95 96 … … 112 113 # plottable is already draw on the panel 113 114 is_new = False 114 115 116 115 117 116 118 if is_new: … … 134 136 #TODO: Should re-factor this 135 137 #if event.plot._xunit != self.graph.prop["xunit"]: 138 136 139 self.graph.xaxis(event.plot._xaxis, event.plot._xunit) 137 140 … … 223 226 id = wx.NewId() 224 227 slicerpop.Append(id, '&Add errors to data') 228 #print "panel scale before ",self.xLabel, self.yLabel 229 #print "cyllinder before adding error", self.plots[self.graph.selected_plottable].x 225 230 wx.EVT_MENU(self, id, self._on_add_errors) 226 231 else: … … 276 281 label, unit = self.plots[self.graph.selected_plottable].get_yaxis() 277 282 new_plot.yaxis(label, unit) 278 283 #print "panel scale ",self.xLabel, self.yLabel 279 284 self.graph.delete(self.plots[self.graph.selected_plottable]) 280 285 281 286 self.graph.add(new_plot) 287 # transforming the view of the new data into the same of the previous data 288 self._onEVT_FUNC_PROPERTY() 289 #print "cyllinder", self.plots[self.graph.selected_plottable].x,self.plots[self.graph.selected_plottable].view.x, new_plot.x, new_plot.view.x 282 290 self.plots[self.graph.selected_plottable]=new_plot 283 291 -
guiframe/local_perspectives/plotting/Plotter2D.py
r8a7a21b rffd23b5 154 154 155 155 self.slicer= None 156 156 157 # Check axis labels 157 158 #TODO: Should re-factor this -
guiframe/local_perspectives/plotting/SectorSlicer.py
r3bae6c8 rffd23b5 184 184 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 185 185 new_plot.group_id = "SectorQ"+self.base.data2D.name 186 new_plot.xtransform = "ln(x)" 186 187 wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot, 187 188 title="SectorQ" )) -
guiframe/local_perspectives/plotting/boxSlicer.py
raa1b747 rffd23b5 13 13 import math 14 14 15 #from Plotter1D import AddPlotEvent15 from sans.guicomm.events import NewPlotEvent, StatusEvent 16 16 import SlicerParameters 17 17 import wx … … 28 28 self.markers = [] 29 29 self.axes = axes 30 self.qmax = self.base. qmax30 self.qmax = self.base.data2D.xmax 31 31 self.connect = self.base.connect 32 32 self.x= x_max … … 35 35 self.theta2= math.pi/3 36 36 ## Number of points on the plot 37 self.nbins = 2037 self.nbins = 30 38 38 self.count=0 39 39 self.error=0 40 40 self.averager=None 41 41 self.left_line = VerticalLine(self, self.base.subplot,color='blue', 42 42 zorder=zorder, … … 45 45 xmin= -self.x, 46 46 xmax= -self.x) 47 self.left_line.qmax = self. base.qmax47 self.left_line.qmax = self.qmax 48 48 49 49 self.right_line= VerticalLine(self, self.base.subplot,color='black', … … 53 53 xmin= self.x, 54 54 xmax= self.x) 55 self.right_line.qmax = self. base.qmax55 self.right_line.qmax = self.qmax 56 56 57 57 self.top_line= HorizontalLine(self, self.base.subplot,color='green', … … 61 61 ymin= self.y, 62 62 ymax= self.y) 63 self.top_line.qmax= self. base.qmax63 self.top_line.qmax= self.qmax 64 64 65 65 self.bottom_line= HorizontalLine(self, self.base.subplot,color='gray', … … 69 69 ymin= -self.y, 70 70 ymax= -self.y) 71 self.bottom_line.qmax= self. base.qmax71 self.bottom_line.qmax= self.qmax 72 72 73 73 self.update() … … 104 104 105 105 def clear(self): 106 self.averager=None 106 107 self.clear_markers() 107 108 self.left_line.clear() … … 171 172 self.top_line.save(ev) 172 173 self.bottom_line.save(ev) 173 174 def _post_data(self): 175 pass 176 177 178 def post_data(self,new_slab=None , nbins=None): 179 """ post data averaging in Q""" 180 x_min= min(self.left_line.x1, self.right_line.x1) 181 x_max= max(self.left_line.x1, self.right_line.x1) 182 183 y_min= min(self.top_line.y1, self.bottom_line.y1) 184 y_max= max(self.top_line.y1, self.bottom_line.y1) 185 186 if nbins !=None: 187 self.nbins 188 if self.averager==None: 189 if new_slab ==None: 190 raise ValueError,"post data:cannot average , averager is empty" 191 self.averager= new_slab 192 bin_width= (x_max + math.fabs(x_min))/self.nbins 193 194 box = self.averager( x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max, 195 bin_width=bin_width) 196 197 boxavg = box(self.base.data2D) 198 199 from sans.guiframe.dataFitting import Data1D 200 if hasattr(boxavg,"dxl"): 201 dxl= boxavg.dxl 202 else: 203 dxl= None 204 if hasattr(boxavg,"dxw"): 205 dxw=boxavg.dxw 206 else: 207 dxw= None 208 209 new_plot = Data1D(x=boxavg.x,y=boxavg.y,dy=boxavg.dy,dxl=dxl,dxw=dxw) 210 new_plot.name = str(self.averager.__name__) +"("+ self.base.data2D.name+")" 211 212 213 214 new_plot.source=self.base.data2D.source 215 new_plot.info=self.base.data2D.info 216 new_plot.interactive = True 217 #print "loader output.detector",output.source 218 new_plot.detector =self.base.data2D.detector 219 # If the data file does not tell us what the axes are, just assume... 220 new_plot.xaxis("\\rm{Q}", 'rad') 221 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 222 new_plot.group_id = str(self.averager.__name__)+self.base.data2D.name 223 new_plot.id = str(self.averager.__name__) 224 wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot, 225 title=str(self.averager.__name__) )) 226 227 174 228 def _post_data(self): 175 229 # Compute data … … 220 274 params["x_max"]= math.fabs(self.right_line.x1) 221 275 params["y_max"]= math.fabs(self.top_line.y1) 222 276 params["nbins"]= self.nbins 223 277 params["errors"] = self.error 224 278 params["count"]= self.count … … 229 283 self.x = float(math.fabs(params["x_max"])) 230 284 self.y = float(math.fabs(params["y_max"] )) 231 285 self.nbins=params["nbins"] 232 286 self.left_line.update(xmin= -1*self.x, 233 287 xmax = -1*self.x, … … 249 303 ymax= -1*self.y) 250 304 251 self. _post_data()305 self.post_data( nbins=None) 252 306 def freeze_axes(self): 253 307 self.base.freeze_axes() … … 503 557 504 558 505 559 class BoxInteractorX(BoxInteractor): 560 def __init__(self,base,axes,color='black', zorder=3): 561 BoxInteractor.__init__(self, base, axes, color=color) 562 self.base=base 563 self._post_data() 564 def _post_data(self): 565 from DataLoader.manipulations import SlabX 566 self.post_data(SlabX ) 567 568 569 class BoxInteractorY(BoxInteractor): 570 def __init__(self,base,axes,color='black', zorder=3): 571 BoxInteractor.__init__(self, base, axes, color=color) 572 self.base=base 573 self._post_data() 574 def _post_data(self): 575 from DataLoader.manipulations import SlabY 576 self.post_data(SlabY ) 577 578 -
guiframe/local_perspectives/plotting/plotting.py
r8a7a21b rffd23b5 119 119 if not hasattr(event.plot,'data'): 120 120 from Plotter1D import ModelPanel1D 121 new_panel = ModelPanel1D(self.parent, -1, style=wx.RAISED_BORDER) 121 if hasattr(event.plot,"xtransform"): 122 print "went here" 123 xtransform = event.plot.xtransform 124 else: 125 126 xtransform =None 127 if hasattr(event.plot,"ytransform"): 128 ytransform= event.plot.ytransform 129 else: 130 ytransform=None 131 new_panel = ModelPanel1D(self.parent, -1,xtransform=xtransform, 132 ytransform=ytransform, style=wx.RAISED_BORDER) 122 133 else: 123 134 from Plotter2D import ModelPanel2D -
guiframe/local_perspectives/plotting/ring.py
r2d107b8 rffd23b5 26 26 self.markers = [] 27 27 self.axes = axes 28 self.qmax = self.base. qmax28 self.qmax = self.base.data2D.xmax 29 29 self.connect = self.base.connect 30 30 … … 34 34 # Inner circle 35 35 self.inner_circle = RingInteractor(self, self.base.subplot, zorder=zorder, r=self.qmax/2.0) 36 self.inner_circle.qmax = self. base.qmax36 self.inner_circle.qmax = self.qmax 37 37 38 38 #self.outer_circle.set_cursor(self.base.qmax/1.8, 0)
Note: See TracChangeset
for help on using the changeset viewer.