Changeset a0a4486 in sasview for invariantview/perspectives
- Timestamp:
- Mar 24, 2010 4:14:33 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:
- da87bce
- Parents:
- d3fac18
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
invariantview/perspectives/invariant/invariant_panel.py
rd3fac18 ra0a4486 91 91 #Draw the panel 92 92 self._do_layout() 93 if self.parent is not None: 94 msg = "" 95 wx.PostEvent(self.parent, StatusEvent(status= msg)) 93 96 97 def err_check_on_data(self): 98 """ 99 Check if data is valid for further computation 100 """ 101 flag = False 102 #edit the panel 103 if self._data is not None: 104 if len(self._data.x[self._data.x==0]) > 0: 105 flag = True 106 msg = "Invariant: one of your q-values is zero. Delete that entry before proceeding" 107 wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop")) 108 return flag 109 94 110 def set_data(self, data): 95 111 """ … … 99 115 #edit the panel 100 116 if self._data is not None: 117 self.err_check_on_data() 101 118 data_name = self._data.name 102 119 data_qmin = min (self._data.x) … … 342 359 msg= "" 343 360 wx.PostEvent(self.parent, StatusEvent(status= msg)) 344 if self._data is None :361 if self._data is None or self.err_check_on_data(): 345 362 return 363 346 364 #clear outputs textctrl 347 365 self._reset_output() … … 370 388 #check the type of extrapolation 371 389 extrapolation = self.get_extrapolation_type(low_q=low_q, high_q=high_q) 372 #prepare a new container to put result of invariant 373 self.inv_container = InvariantContainer() 390 374 391 #Compute invariant 375 392 try: … … 415 432 self.surface_tcl.Clear() 416 433 self.surface_err_tcl.Clear() 434 #prepare a new container to put result of invariant 435 self.inv_container = InvariantContainer() 417 436 418 437 def _define_structure(self):
Note: See TracChangeset
for help on using the changeset viewer.