Changeset 345e7e4 in sasview for src/sas/sasgui
- Timestamp:
- Dec 19, 2016 7:23:36 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:
- b61bd57
- Parents:
- f2724b6
- git-author:
- jhbakker <j.h.bakker@…> (12/19/16 07:23:36)
- git-committer:
- GitHub <noreply@…> (12/19/16 07:23:36)
- Location:
- src/sas/sasgui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/dataFitting.py
r1fac6c0 r345e7e4 17 17 """ 18 18 """ 19 def __init__(self, x=None, y=None, dx=None, dy=None , lam=None, dlam=None, isSesans=False):19 def __init__(self, x=None, y=None, dx=None, dy=None): 20 20 """ 21 21 """ … … 24 24 if y is None: 25 25 y = [] 26 self.isSesans = isSesans 27 PlotData1D.__init__(self, x, y, dx, dy, lam, dlam) 28 LoadData1D.__init__(self, x, y, dx, dy, lam, dlam, isSesans) 26 PlotData1D.__init__(self, x, y, dx, dy) 27 LoadData1D.__init__(self, x, y, dx, dy) 29 28 self.id = None 30 29 self.list_group_id = [] … … 69 68 # First, check the data compatibility 70 69 dy, dy_other = self._validity_check(other) 71 result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=None)70 result = Data1D(x=[], y=[], dx=None, dy=None) 72 71 result.clone_without_data(length=len(self.x), clone=self) 73 72 result.copy_from_datainfo(data1d=self) … … 116 115 # First, check the data compatibility 117 116 self._validity_check_union(other) 118 result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=None)117 result = Data1D(x=[], y=[], dx=None, dy=None) 119 118 tot_length = len(self.x) + len(other.x) 120 119 result = self.clone_without_data(length=tot_length, clone=result) 121 if self.dlam == None or other.dlam is None:122 result.dlam = None123 else:124 result.dlam = numpy.zeros(tot_length)125 120 if self.dy == None or other.dy is None: 126 121 result.dy = None … … 146 141 result.y = numpy.append(self.y, other.y) 147 142 result.y = result.y[ind] 148 result.lam = numpy.append(self.lam, other.lam)149 result.lam = result.lam[ind]150 if result.dlam != None:151 result.dlam = numpy.append(self.dlam, other.dlam)152 result.dlam = result.dlam[ind]153 143 if result.dy != None: 154 144 result.dy = numpy.append(self.dy, other.dy) … … 270 260 # First, check the data compatibility 271 261 self._validity_check_union(other) 272 result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=[])262 result = Data1D(x=[], y=[], dx=None, dy=None) 273 263 tot_length = len(self.x)+len(other.x) 274 264 result.clone_without_data(length=tot_length, clone=self) 275 if self.dlam == None or other.dlam is None:276 result.dlam = None277 else:278 result.dlam = numpy.zeros(tot_length)279 265 if self.dy == None or other.dy is None: 280 266 result.dy = None … … 299 285 result.y = numpy.append(self.y, other.y) 300 286 result.y = result.y[ind] 301 result.lam = numpy.append(self.lam, other.lam)302 result.lam = result.lam[ind]303 287 if result.dy != None: 304 288 result.dy = numpy.append(self.dy, other.dy) -
src/sas/sasgui/guiframe/data_manager.py
r1fac6c0 r345e7e4 62 62 if issubclass(Data2D, data.__class__): 63 63 new_plot = Data2D(image=None, err_image=None) 64 elif data.meta_data['loader'] == 'SESANS': 65 new_plot = Data1D(x=[], y=[], dx=None, dy=None, lam=None, dlam=None, isSesans=True) 66 else: 67 new_plot = Data1D(x=[], y=[], dx=None, dy=None, lam=None, dlam=None) #SESANS check??? 64 else: 65 new_plot = Data1D(x=[], y=[], dx=None, dy=None) 68 66 69 67 new_plot.copy_from_datainfo(data) -
src/sas/sasgui/perspectives/fitting/basepage.py
r55bc5a7f r345e7e4 143 143 self.theory_qmin_x = None 144 144 self.theory_qmax_x = None 145 self.cb1 = None146 145 self.btEditMask = None 147 146 self.btFit = None … … 282 281 num=self.npts_x, endpoint=True) 283 282 self.data = Data1D(x=x) 284 #self.data.xaxis('\\rm{Q}', "A^{-1}") 285 self.data.xaxis('\\rm{X}', "") 286 #self.data.yaxis('\\rm{Intensity}', "cm^{-1}") 287 self.data.yaxis('\\rm{Y}', "") 283 self.data.xaxis('\\rm{Q}', "A^{-1}") 284 self.data.yaxis('\\rm{Intensity}', "cm^{-1}") 288 285 self.data.is_data = False 289 286 self.data.id = str(self.uid) + " data" … … 310 307 num=self.npts_x, endpoint=True, base=10.0) 311 308 self.data = Data1D(x=x) 312 #self.data.xaxis('\\rm{Q}', "A^{-1}") 313 #self.data.yaxis('\\rm{Intensity}', "cm^{-1}") 314 self.data.xaxis('\\rm{X}', "") 315 self.data.yaxis('\\rm{Y}', "") 309 self.data.xaxis('\\rm{Q}', "A^{-1}") 310 self.data.yaxis('\\rm{Intensity}', "cm^{-1}") 316 311 self.data.is_data = False 317 312 self.data.id = str(self.uid) + " data" … … 1129 1124 # set data, etc. from the state 1130 1125 # reset page between theory and fitting from bookmarking 1131 #if state.data == None:1132 # data = None1133 #else:1134 1126 data = state.data 1135 1127 … … 1348 1340 except Exception: 1349 1341 logging.error(traceback.format_exc()) 1350 1351 # Make sure the check box updated when all checked1352 if self.cb1.GetValue():1353 self.select_all_param(None)1354 1342 1355 1343 def _selectDlg(self): … … 2493 2481 item[2].Enable() 2494 2482 2495 # Make sure the check box updated when all checked 2496 if self.cb1.GetValue(): 2497 #self.select_all_param(None) 2498 self.get_all_checked_params() 2483 # Make sure the check box updated 2484 self.get_all_checked_params() 2499 2485 2500 2486 # update params … … 3675 3661 call back for model selection if implemented 3676 3662 """ 3677 def select_all_param(self, event):3678 """3679 set to true or false all checkBox if implemented3680 """3681 3663 def get_weight_flag(self): 3682 3664 """ -
src/sas/sasgui/perspectives/fitting/fitpage.py
rf668101 r345e7e4 168 168 self.set_data(data) 169 169 elif self.dataSource.GetCount() > 0: 170 171 170 pos = self.dataSource.GetSelection() 172 171 data = self.dataSource.GetClientData(pos) … … 618 617 # fill a sizer with the combobox to select dispersion type 619 618 model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 620 CHECK_STATE = self.cb1.GetValue()619 CHECK_STATE = False 621 620 622 621 ix = 0 … … 962 961 963 962 self.state.model = self.model.clone() 964 965 963 # save state into 966 964 self._copy_parameters_state(self.parameters, self.state.parameters) … … 973 971 wx.PostEvent(self.parent, 974 972 StatusEvent(status=" Selected Distribution: Gaussian")) 975 976 973 # Fill the list of fittable parameters 977 974 self.get_all_checked_params() … … 2685 2682 self._manager.set_param2fit(self.uid, param2fit) 2686 2683 2687 2688 2684 def select_param(self, event=None): 2689 2685 """ … … 2732 2728 if len(self.fittable_param) > 0: 2733 2729 len_orient_para *= 2 2734 #Set the value of checkbox that selected every checkbox or not2735 if len(self.parameters) + len(self.fittable_param) - len_orient_para \2736 == len(self.param_toFit):2737 self.cb1.SetValue(True)2738 else:2739 self.cb1.SetValue(False)2740 2730 2741 2731 self.save_current_state_fit() … … 2839 2829 iy = 0 2840 2830 ix = 0 2841 select_text = "Select All" 2842 self.cb1 = wx.CheckBox(self, wx.ID_ANY, str(select_text), (10, 10)) 2843 wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 2844 self.cb1.SetToolTipString("To check/uncheck all the boxes below.") 2845 self.cb1.SetValue(True) 2846 2847 sizer.Add(self.cb1, (iy, ix), (1, 1), \ 2848 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 2831 sizer.Add(wx.StaticText(self, wx.ID_ANY, 'Parameter'), 2832 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 2849 2833 ix += 1 2850 2834 self.text2_2 = wx.StaticText(self, wx.ID_ANY, 'Value') … … 2873 2857 self.text2_4.Hide() 2874 2858 2875 CHECK_STATE = self.cb1.GetValue()2859 CHECK_STATE = False 2876 2860 for item in keys: 2877 2861 -
src/sas/sasgui/plottools/plottables.py
rf668101 r345e7e4 1023 1023 """ 1024 1024 1025 def __init__(self, x, y, dx=None, dy=None , lam=None, dlam=None):1025 def __init__(self, x, y, dx=None, dy=None): 1026 1026 """ 1027 1027 Draw points specified by x[i],y[i] in the current color/symbol. … … 1037 1037 self.x = x 1038 1038 self.y = y 1039 self.lam = lam1040 1039 self.dx = dx 1041 1040 self.dy = dy 1042 self.dlam = dlam1043 1041 self.source = None 1044 1042 self.detector = None
Note: See TracChangeset
for help on using the changeset viewer.