Changeset a6d3553 in sasview for fittingview/src/sans/perspectives
- Timestamp:
- Sep 29, 2011 12:22:19 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:
- 63a2371
- Parents:
- a49a916
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
r817991b ra6d3553 77 77 self.graph_id = None 78 78 #Q range for data set 79 self.qmin_data_set = None79 self.qmin_data_set = numpy.inf 80 80 self.qmax_data_set = None 81 81 self.npts_data_set = 0 -
fittingview/src/sans/perspectives/fitting/fitpage.py
r817991b ra6d3553 109 109 self.data_list = data_list 110 110 self.enable_datasource() 111 if data_list:111 if len(data_list) > 0: 112 112 #find the maximum range covering all data 113 qmin, qmax, _ = self.compute_data_range(data_list[0]) 114 self.qmin_data_set, self.qmax_data_set = qmin, qmax 115 self.npts_data_set = 0 113 qmin, qmax, npts = self.compute_data_set_range(data_list) 114 self.qmin_data_set = qmin 115 self.qmax_data_set = qmax 116 self.npts_data_set = npts 117 118 self.qmin.SetValue(str(self.qmin_data_set)) 119 self.qmax.SetValue(str(self.qmax_data_set)) 120 self.qmin.SetBackgroundColour("white") 121 self.qmax.SetBackgroundColour("white") 122 self.qmin_x = self.qmin_data_set 123 self.qmax_x = self.qmax_data_set 124 self.state.qmin = self.qmin_x 125 self.state.qmax = self.qmax_x 126 116 127 for data in self.data_list: 117 128 if data is not None: 118 self.compute_data_set_range(data)119 129 self.dataSource.Append(str(data.name), clientData=data) 120 130 self.dataSource.SetSelection(0) … … 1785 1795 return self.enable2D 1786 1796 1787 def compute_data_set_range(self, data ):1797 def compute_data_set_range(self, data_list): 1788 1798 """ 1789 1799 find the range that include all data in the set 1790 1800 return the minimum and the maximum values 1791 1801 """ 1792 if data is not None: 1793 qmin, qmax, npts = self.compute_data_range(data) 1794 self.qmin_data_set = min(self.qmin_data_set, qmin) 1795 self.qmax_data_set = max(self.qmax_data_set, qmax) 1796 self.npts_data_set += npts 1802 if data_list is not None and data_list != []: 1803 for data in data_list: 1804 qmin, qmax, npts = self.compute_data_range(data) 1805 self.qmin_data_set = min(self.qmin_data_set, qmin) 1806 self.qmax_data_set = max(self.qmax_data_set, qmax) 1807 self.npts_data_set += npts 1808 return self.qmin_data_set, self.qmax_data_set, self.npts_data_set 1797 1809 1798 1810 def compute_data_range(self, data): … … 1842 1854 1843 1855 if self.data is None: 1844 data_min = ""1845 data_max = ""1846 1856 data_name = "" 1847 1857 self._set_bookmark_flag(False) … … 1894 1904 self.structurebox.Enable() 1895 1905 data_name = self.data.name 1896 data_min, data_max = self.qmin_data_set, self.qmax_data_set 1897 npts = self.npts_data_set 1906 _, _, npts = self.compute_data_range(self.data) 1898 1907 #set maximum range for x in linear scale 1899 1908 if not hasattr(self.data, "data"): #Display only for 1D data fit … … 1912 1921 self.Npts_total.Bind(wx.EVT_MOUSE_EVENTS, self._npts_click) 1913 1922 self.dataSource.SetValue(data_name) 1914 self.qmin_x = data_min1915 self.qmax_x = data_max1916 #self.minimum_q.SetValue(str(data_min))1917 #self.maximum_q.SetValue(str(data_max))1918 if data_min is None:1919 data_min = ""1920 if data_max is None:1921 data_max = ""1922 self.qmin.SetValue(str(data_min))1923 self.qmax.SetValue(str(data_max))1924 self.qmin.SetBackgroundColour("white")1925 self.qmax.SetBackgroundColour("white")1926 1923 self.state.data = data 1927 self.state.qmin = self.qmin_x1928 self.state.qmax = self.qmax_x1929 1924 self.enable_fit_button() 1930 1925 # send graph_id to page_finder
Note: See TracChangeset
for help on using the changeset viewer.