Changeset ee18d33 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
- Timestamp:
- Aug 9, 2017 7:52:07 AM (7 years ago)
- Branches:
- 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
- Children:
- 38eb433
- Parents:
- 985ad94
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
rdc5ef15 ree18d33 178 178 def computeDataRange(self): 179 179 """ 180 Wrapper for calculating the data range based on local dataset 181 """ 182 return self.computeRangeFromData(self.data) 183 184 def computeRangeFromData(self, data): 185 """ 180 186 Compute the minimum and the maximum range of the data 181 187 return the npts contains in data 182 188 """ 183 189 qmin, qmax, npts = None, None, None 184 if isinstance( self.data, Data1D):190 if isinstance(data, Data1D): 185 191 try: 186 qmin = min( self.data.x)187 qmax = max( self.data.x)188 npts = len( self.data.x)192 qmin = min(data.x) 193 qmax = max(data.x) 194 npts = len(data.x) 189 195 except (ValueError, TypeError): 190 196 msg = "Unable to find min/max/length of \n data named %s" % \ … … 195 201 qmin = 0 196 202 try: 197 x = max(np.fabs( self.data.xmin), np.fabs(self.data.xmax))198 y = max(np.fabs( self.data.ymin), np.fabs(self.data.ymax))203 x = max(np.fabs(data.xmin), np.fabs(data.xmax)) 204 y = max(np.fabs(data.ymin), np.fabs(data.ymax)) 199 205 except (ValueError, TypeError): 200 206 msg = "Unable to find min/max of \n data named %s" % \ … … 202 208 raise ValueError, msg 203 209 qmax = np.sqrt(x * x + y * y) 204 npts = len( self.data.data)210 npts = len(data.data) 205 211 return qmin, qmax, npts
Note: See TracChangeset
for help on using the changeset viewer.