Changeset eb320682 in sasview
- Timestamp:
- Jul 12, 2016 5:29:11 AM (8 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 41345d7e
- Parents:
- c512f7d
- Location:
- src/sas
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/corfunc/corfunc_calculator.py
ra2db1ab reb320682 201 201 mask = np.where(np.abs((y-(m*x+b))/y) < 0.01)[0] 202 202 if len(mask) == 0: # Return garbage for bad fits 203 return garbage203 return { 'max': self._round_sig_figs(x[maxs[0]], 6) } 204 204 dtr = x[mask[0]] # Beginning of Linear Section 205 205 d0 = x[mask[-1]] # End of Linear Section -
src/sas/sasgui/perspectives/corfunc/corfunc_panel.py
rc512f7d reb320682 108 108 return 109 109 if self.state.outputs is not None and self.state.outputs != {}: 110 self.set_extracted_params(self.state.outputs )110 self.set_extracted_params(self.state.outputs, reset=True) 111 111 112 112 def get_state(self): … … 151 151 self._calculator.set_data(data) 152 152 # Reset the outputs 153 self.set_extracted_params(None )153 self.set_extracted_params(None, reset=True) 154 154 if self._manager is not None: 155 155 self._manager.clear_data() … … 285 285 self._calculator.background = bg 286 286 287 def set_extracted_params(self, params ):287 def set_extracted_params(self, params=None, reset=False): 288 288 self.extracted_params = params 289 error = False 289 290 if params is None: 291 if not reset: error = True 290 292 for key in OUTPUT_STRINGS.keys(): 291 293 self._output_boxes[key].SetValue('-') 292 294 else: 293 for key in OUTPUT_STRINGS.keys(): 294 value = params[key] 295 if len(params) < len(OUTPUT_STRINGS): 296 # Not all parameters were calculated 297 error = True 298 for key, value in params.iteritems(): 295 299 self._output_boxes[key].SetValue(value) 300 if error: 301 msg = 'Not all parameters were able to be calculated' 302 wx.PostEvent(self._manager.parent, StatusEvent( 303 status=msg, info='error')) 304 296 305 297 306 def plot_qrange(self, active=None, leftdown=False):
Note: See TracChangeset
for help on using the changeset viewer.