Changeset 7db52f1 in sasview for fittingview/src/sans/perspectives
- Timestamp:
- Oct 12, 2011 1:40:24 PM (13 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:
- 7643ba2
- Parents:
- 18253cd
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/fit_thread.py
r6a4002d r7db52f1 27 27 yieldtime = 0.01, 28 28 worktime = 0.01, 29 ftol = None): 29 ftol = None, 30 reset_flag = False): 30 31 CalcThread.__init__(self,completefn, 31 32 updatefn, … … 42 43 #Relative error desired in the sum of squares. 43 44 self.ftol = ftol 45 self.reset_flag = reset_flag 44 46 45 47 def isquit(self): … … 63 65 list_curr_thread = [] 64 66 list_ftol = [] 67 list_reset_flag = [] 65 68 list_map_get_attr = [] 66 69 list_fit_function = [] … … 71 74 list_curr_thread.append(None) 72 75 list_ftol.append(self.ftol) 76 list_reset_flag.append(self.reset_flag) 73 77 list_fit_function.append('fit') 74 78 list_map_get_attr.append(map_getattr) 75 79 #from multiprocessing import Pool 76 80 inputs = zip(list_map_get_attr,self.fitter, list_fit_function, 77 list_handler, list_q, list_curr_thread,list_ftol) 81 list_handler, list_q, list_curr_thread,list_ftol, 82 list_reset_flag) 78 83 result = map(map_apply, inputs) 79 84 self.complete(result=result, -
fittingview/src/sans/perspectives/fitting/fitproblem.py
ra3c8e8f r7db52f1 595 595 self.fit_data = None 596 596 # original data: should not be modified 597 self.original_data = copy.deepcopy(data)597 self.original_data = data 598 598 # fit data: used for fit and can be modified for convenience 599 599 self.fit_data = copy.deepcopy(data) … … 609 609 return self.fit_data 610 610 611 def get_origin_data(self): 612 """ 613 """ 614 return self.original_data 615 611 616 def set_weight(self, is2d, flag=None): 612 617 """ -
fittingview/src/sans/perspectives/fitting/fitting.py
r47d9be79 r7db52f1 86 86 ## Fit engine 87 87 self._fit_engine = 'scipy' 88 self._gui_engine = None 88 89 ## Relative error desired in the sum of squares (float); scipy only 89 90 self.ftol = SANS_F_TOL 91 self.batch_reset_flag = True 90 92 #List of selected data 91 93 self.selected_data_list = [] … … 705 707 if value.get_scheduled() == 1: 706 708 fitproblem_count += 1 707 709 self._gui_engine = self._return_engine_type() 708 710 self.fitproblem_count = fitproblem_count 709 711 if self._fit_engine == "park": … … 721 723 fitter_list.append(sim_fitter) 722 724 is_single_fit = False 725 723 726 724 727 self.fitproblem_count = fitproblem_count … … 818 821 page_id=list_page_id, 819 822 completefn=self._batch_fit_complete, 820 ftol=self.ftol) 823 ftol=self.ftol, 824 reset_flag=self.batch_reset_flag) 821 825 else: 822 826 # single fit: not batch and not simul fit … … 1096 1100 msg += "Data %s and Model %s did not fit.\n" % (data_name, 1097 1101 model_name) 1098 #print msg1102 print msg 1099 1103 wx.PostEvent(self.parent, StatusEvent(status=msg, 1100 1104 error="error", … … 1156 1160 flag = issubclass(data.__class__, Data2D) 1157 1161 if not flag: 1158 #print "Batch complete", len(res.theory), len(res.index)1159 1162 self._complete1D(x=data.x, y=res.theory, page_id=pid, 1160 1163 elapsed=None, … … 1163 1166 toggle_mode_on=False, state=None, 1164 1167 data=data, update_chisqr=False, 1165 source=' model')1168 source='fit') 1166 1169 else: 1167 1170 self._complete2D(image=data.data, data=data, … … 1173 1176 toggle_mode_on=False, state=None, 1174 1177 update_chisqr=False, 1175 source=' model')1178 source='fit') 1176 1179 1177 1180 self.on_set_batch_result(page_id=pid, … … 1204 1207 cell.label = data.name 1205 1208 cell.value = index 1206 theory_data.id = wx.NewId()1207 theory_data.name = data.name + "[%s]" % str(model.__class__.__name__)1209 theory_data.id = str(page_id) + "model" 1210 theory_data.name = model.name + "[%s]" % str(model.__class__.__name__) 1208 1211 cell.object = [data, theory_data] 1209 1212 batch_outputs["Data"].append(cell) … … 1233 1236 :param elapsed: time spent at the fitting level 1234 1237 """ 1238 # reset fit_engine if changed by simul_fit 1239 self._on_change_engine(self._gui_engine) 1235 1240 result = result[0] 1236 1241 self.fit_thread_list = {} … … 1450 1455 caption = current_pg.window_caption 1451 1456 self.page_finder[page_id].set_fit_tab_caption(caption=caption) 1452 1457 new_plot.id = str(page_id) + "model" 1453 1458 self.page_finder[page_id].set_theory_data(data=new_plot, 1454 1459 fid=data.id) -
fittingview/src/sans/perspectives/fitting/simfitpage.py
r1153d0e r7db52f1 622 622 self.btFit.SetToolTipString("Perform fit.") 623 623 624 text= "Hint: Park fitting engine will be selected automatically. \n"624 text= "Hint: Park fitting engine will be used automatically. \n" 625 625 #text+= "automatically for more than 2 combinations checked" 626 626 text_hint = wx.StaticText(self,-1,text)
Note: See TracChangeset
for help on using the changeset viewer.