Changeset ba64348 in sasview for sansview/perspectives/fitting
- Timestamp:
- Apr 6, 2011 11:02:58 AM (14 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:
- 64e44c1
- Parents:
- 2ca51f44
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
r1b1bbf9 rba64348 1201 1201 #Check if # of points for theory model are valid(>0). 1202 1202 # check for 2d 1203 if self.data.__class__.__name__ =="Data2D": 1204 # set mask 1205 radius= numpy.sqrt( self.data.qx_data*self.data.qx_data + 1206 self.data.qy_data*self.data.qy_data ) 1207 index_data = ((self.qmin_x <= radius)& \ 1208 (radius<= self.qmax_x)) 1209 index_data = (index_data)&(self.data.mask) 1210 index_data = (index_data)&(numpy.isfinite(self.data.data)) 1211 if len(index_data[index_data]) < 10: 1212 msg = "Cannot Plot :No or too little npts in" 1213 msg += " that data range!!! " 1214 wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 1215 return 1203 if self.data is not None: 1204 if self.data.__class__.__name__ =="Data2D": 1205 # set mask 1206 radius= numpy.sqrt( self.data.qx_data*self.data.qx_data + 1207 self.data.qy_data*self.data.qy_data ) 1208 index_data = ((self.qmin_x <= radius)& \ 1209 (radius<= self.qmax_x)) 1210 index_data = (index_data)&(self.data.mask) 1211 index_data = (index_data)&(numpy.isfinite(self.data.data)) 1212 if len(index_data[index_data]) < 10: 1213 msg = "Cannot Plot :No or too little npts in" 1214 msg += " that data range!!! " 1215 wx.PostEvent(self.parent.parent, StatusEvent(status = msg )) 1216 return 1217 else: 1218 self.data.mask = index_data 1219 #self.Npts_fit.SetValue(str(len(self.data.mask))) 1220 self.set_npts2fit() 1216 1221 else: 1217 self.data.mask = index_data 1218 #self.Npts_fit.SetValue(str(len(self.data.mask))) 1219 self.set_npts2fit() 1220 else: 1221 index_data = ((self.qmin_x <= self.data.x)& \ 1222 (self.data.x <= self.qmax_x)) 1223 self.Npts_fit.SetValue(str(len(self.data.x[index_data]))) 1224 1222 index_data = ((self.qmin_x <= self.data.x)& \ 1223 (self.data.x <= self.qmax_x)) 1224 self.Npts_fit.SetValue(str(len(self.data.x[index_data]))) 1225 1225 1226 else: 1226 1227 tcrtl.SetBackgroundColour("pink")
Note: See TracChangeset
for help on using the changeset viewer.