Changeset 6d55d81 in sasview
- Timestamp:
- Apr 21, 2010 4:23:01 PM (15 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:
- 1c271f2
- Parents:
- d8731ca
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Invariant/invariant.py
rc4f52e3 r6d55d81 385 385 #Process only data that inherited from DataLoader.Data_info.Data1D 386 386 raise ValueError,"Data must be of type DataLoader.Data1D" 387 #from copy import deepcopy 387 388 new_data = (self._scale * data) - self._background 388 389 … … 517 518 return result_data 518 519 520 def get_data(self): 521 """ 522 @return self._data 523 """ 524 return self._data 525 519 526 def get_extrapolation_power(self, range='high'): 520 527 """ -
invariantview/perspectives/invariant/invariant.py
rf29a433 r6d55d81 9 9 """ 10 10 import wx 11 from copy import deepcopy 11 12 12 from sans.invariant import invariant 13 13 … … 163 163 id = None 164 164 if hasattr(item,"id"): 165 id = deepcopy(item.id)165 id = item.id 166 166 167 167 data = Data1D(x=item.x, y=item.y, dx=None, dy=None) … … 171 171 data.name = item.name 172 172 ## allow to highlight data when plotted 173 data.interactive = deepcopy(item.interactive)173 data.interactive = item.interactive 174 174 ## when 2 data have the same id override the 1 st plotted 175 175 data.id = id … … 222 222 new_plot.id = self.__data.id + name 223 223 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=self.__data.name)) 224 225 226 224 225 def plot_data(self, data): 226 """ 227 replot the current data if the user enters a new scale or background 228 """ 229 new_plot = self.copy_data(item=self.__data, dy=self.__data.dy) 230 new_plot.x = data.x 231 new_plot.y = data.y 232 new_plot.dx = data.dx 233 new_plot.dy = data.dy 234 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=new_plot.name)) 235 -
invariantview/perspectives/invariant/invariant_panel.py
re3f721e4 r6d55d81 13 13 from invariant_details import InvariantDetailsPanel, InvariantContainer 14 14 from invariant_widgets import OutputTextCtrl, InvTextCtrl 15 15 16 # The minimum q-value to be used when extrapolating 16 17 Q_MINIMUM = 1e-5 … … 66 67 #Data uses for computation 67 68 self._data = data 69 self._scale = SCALE 70 self._background = BACKGROUND 68 71 #container of invariant value 69 72 self.inv_container = None … … 151 154 raise ValueError, "Need a background" 152 155 if check_float(self.scale_tcl): 156 if float(scale)<= 0.0: 157 self.scale_tcl.SetBackgroundColour("pink") 158 self.scale_tcl.Refresh() 159 raise ValueError, "Receive invalid value for scale: %s"%(scale) 153 160 return float(scale) 154 161 else: 155 raise ValueError, "Receive invalid value for background: %s"%(scale)162 raise ValueError, "Receive invalid value for scale : %s"%(scale) 156 163 157 164 def get_contrast(self): … … 392 399 393 400 #Compute invariant 401 bkg_changed = False 402 scale_changed = False 394 403 try: 395 404 self.get_qstar(inv=inv) 405 #if scale_changed or bkg_changed: 406 self._manager.plot_data(data=inv.get_data()) 407 396 408 except: 397 409 msg= "Error occurred computing invariant: %s"%sys.exc_value
Note: See TracChangeset
for help on using the changeset viewer.