Changeset fa65e99 in sasview
- Timestamp:
- Mar 10, 2011 10:18:56 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:
- a284455
- Parents:
- e2f0554
- Location:
- sansview/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r8b6f489 rfa65e99 1646 1646 if not self.disable_smearer.GetValue(): 1647 1647 temp_smear= self.current_smearer 1648 print "_draw_model", self.enable2D1648 toggle_mode_on = self.model_view.IsEnabled() 1649 1649 self._manager.draw_model(self.model, 1650 1650 data=self.data, … … 1654 1654 qstep= float(self.npts_x), 1655 1655 id=self.id, 1656 toggle_mode_on=toggle_mode_on, 1656 1657 state = self.state, 1657 1658 enable2D=self.enable2D) -
sansview/perspectives/fitting/fitpage.py
re2f0554 rfa65e99 1524 1524 self.enable2D = False 1525 1525 self.model_view.SetLabel("1D Mode") 1526 1526 1527 self.model_view.Disable() 1527 1528 self._draw_model() -
sansview/perspectives/fitting/fitting.py
r8b6f489 rfa65e99 455 455 enable1D=True, enable2D=False, 456 456 state=None, 457 toggle_mode_on=False, 457 458 qmin=DEFAULT_QMIN, qmax=DEFAULT_QMAX, qstep=DEFAULT_NPTS): 458 459 """ … … 480 481 qmin=qmin, 481 482 qmax=qmax, 483 toggle_mode_on=toggle_mode_on, 482 484 state=state, 483 485 qstep=qstep) … … 492 494 qmax=qmax, 493 495 state=state, 496 toggle_mode_on=toggle_mode_on, 494 497 qstep=qstep) 495 498 … … 1088 1091 1089 1092 1090 def _complete1D(self, x,y, id, elapsed,index,model,state=None, data=None): 1093 def _complete1D(self, x,y, id, elapsed,index,model, 1094 toggle_mode_on=False,state=None, data=None): 1091 1095 """ 1092 1096 Complete plotting 1D data … … 1122 1126 new_plot.is_data = False 1123 1127 new_plot.id = str(id) + " Model1D" 1128 print "new_plot.id", new_plot.id 1124 1129 #find if this theory was already plotted and replace that plot given 1125 1130 #the same id … … 1128 1133 if theory_data is not None: 1129 1134 temp_id = theory_data.id 1135 print "theory_data id", temp_id 1130 1136 new_plot.id = temp_id 1137 if toggle_mode_on: 1138 new_plot.id = str(id) + " Model" 1131 1139 new_plot.name = model.name + " ["+ str(model.__class__.__name__)+ "]" 1132 1140 new_plot.xaxis(_xaxis, _xunit) … … 1141 1149 self.parent.append_theory(data_id=data_id, 1142 1150 theory=new_plot, state=state) 1151 1143 1152 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 1144 1153 title= str(new_plot.title))) … … 1166 1175 1167 1176 def _complete2D(self, image, data, model, id, elapsed, index, qmin, 1168 qmax, state=None,qstep=DEFAULT_NPTS):1177 qmax, toggle_mode_on=False,state=None,qstep=DEFAULT_NPTS): 1169 1178 """ 1170 1179 Complete get the result of modelthread and create model 2D … … 1173 1182 err_image = numpy.zeros(numpy.shape(image)) 1174 1183 1175 theory= Data2D(image=image, err_image=err_image)1176 theory.name = model.name1184 new_plot= Data2D(image=image, err_image=err_image) 1185 new_plot.name = model.name 1177 1186 1178 1187 if data is None: 1179 self._fill_default_model2D(theory= theory,1188 self._fill_default_model2D(theory=new_plot, 1180 1189 qmax=qmax, 1181 1190 id=id, … … 1184 1193 1185 1194 else: 1186 theory.id = str(id) + "Model2D"1187 theory.group_id = str(id) + "Model2D"1195 new_plot.id = str(id) + " Model2D" 1196 new_plot.group_id = str(id) + " Model2D" 1188 1197 1189 theory.x_bins = data.x_bins1190 theory.y_bins = data.y_bins1191 theory.detector = data.detector1192 theory.source = data.source1193 theory.is_data = False1194 theory.qx_data = data.qx_data1195 theory.qy_data = data.qy_data1196 theory.q_data = data.q_data1198 new_plot.x_bins = data.x_bins 1199 new_plot.y_bins = data.y_bins 1200 new_plot.detector = data.detector 1201 new_plot.source = data.source 1202 new_plot.is_data = False 1203 new_plot.qx_data = data.qx_data 1204 new_plot.qy_data = data.qy_data 1205 new_plot.q_data = data.q_data 1197 1206 #numpy.zeros(len(data.err_data))#data.err_data 1198 theory.err_data = err_image1199 theory.mask = data.mask1207 new_plot.err_data = err_image 1208 new_plot.mask = data.mask 1200 1209 ## plot boundaries 1201 theory.ymin = data.ymin1202 theory.ymax = data.ymax1203 theory.xmin = data.xmin1204 theory.xmax = data.xmax1205 theory.name = model.name + " ["+ str(model.__class__.__name__)+ "]"1206 theory.title = "Analytical model 2D "1207 theory_data = deepcopy( theory)1210 new_plot.ymin = data.ymin 1211 new_plot.ymax = data.ymax 1212 new_plot.xmin = data.xmin 1213 new_plot.xmax = data.xmax 1214 new_plot.name = model.name + " ["+ str(model.__class__.__name__)+ "]" 1215 new_plot.title = "Analytical model 2D " 1216 theory_data = deepcopy(new_plot) 1208 1217 theory_data.name = "Unknown" 1209 1218 self.page_finder[id].set_theory_data(theory_data) … … 1216 1225 data_id = data.id 1217 1226 self.parent.append_theory(data_id=data_id, 1218 theory=theory, state=state) 1219 1227 theory=new_plot, state=state) 1228 if toggle_mode_on: 1229 new_plot.id = str(id) + " Model" 1220 1230 ## plot 1221 wx.PostEvent(self.parent, NewPlotEvent(plot= theory,1222 title= theory.title))1231 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 1232 title=new_plot.title)) 1223 1233 # Chisqr in fitpage 1224 1234 current_pg = self.fit_panel.get_page_by_id(id) … … 1231 1241 description=None, enable2D=False, 1232 1242 state=None, 1243 toggle_mode_on=False, 1233 1244 qmin=DEFAULT_QMIN, qmax=DEFAULT_QMAX, 1234 1245 qstep=DEFAULT_NPTS): … … 1280 1291 qmax=qmax, 1281 1292 qstep=qstep, 1293 toggle_mode_on=toggle_mode_on, 1282 1294 state=state, 1283 1295 completefn=self._complete2D, … … 1294 1306 qmin=DEFAULT_QMIN, qmax=DEFAULT_QMAX, 1295 1307 state=None, 1308 toggle_mode_on=False, 1296 1309 qstep=DEFAULT_NPTS, enable1D=True): 1297 1310 """ … … 1331 1344 smearer=smearer, 1332 1345 state=state, 1346 toggle_mode_on=toggle_mode_on, 1333 1347 completefn=self._complete1D, 1334 1348 updatefn=self._update1D) -
sansview/perspectives/fitting/model_thread.py
r5ef55d2 rfa65e99 17 17 id , 18 18 state=None, 19 toggle_mode_on=False, 19 20 completefn = None, 20 21 updatefn = None, … … 29 30 self.qmax= qmax 30 31 self.qstep= qstep 31 32 self.toggle_mode_on = toggle_mode_on 32 33 self.x = x 33 34 self.y = y … … 124 125 model=self.model, 125 126 state=self.state, 127 toggle_mode_on=self.toggle_mode_on, 126 128 elapsed=elapsed, 127 129 index=index_model, … … 141 143 qmax=None, 142 144 smearer=None, 145 toggle_mode_on=False, 143 146 state=None, 144 147 completefn = None, … … 154 157 worktime) 155 158 self.x = numpy.array(x) 156 self.data = data157 self.qmin = qmin158 self.qmax = qmax159 self.data = data 160 self.qmin = qmin 161 self.qmax = qmax 159 162 self.model = model 163 self.toggle_mode_on = toggle_mode_on 160 164 self.state = state 161 165 self.page_id = id 162 self.smearer = smearer166 self.smearer = smearer 163 167 self.starttime = 0 164 168 … … 184 188 id=self.page_id, 185 189 state=self.state, 190 toggle_mode_on=self.toggle_mode_on, 186 191 elapsed=elapsed,index=index, model=self.model, 187 192 data=self.data)
Note: See TracChangeset
for help on using the changeset viewer.