Changeset caa1226 in sasview
- Timestamp:
- Oct 16, 2008 3:42:20 PM (16 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:
- e1a310f
- Parents:
- fdb0f8b
- Location:
- sansview
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage2D.py
rbcd6d51 rcaa1226 203 203 qmin = float(self.xmin.GetValue()) 204 204 qmax = float(self.xmax.GetValue()) 205 #x,y,dy = [numpy.asarray(v) for v in (self.data.x,self.data.y,self.data.dy)] 206 #if qmin==None and qmax==None: 207 # fx =numpy.asarray([self.model.run(v) for v in x]) 208 # res=(y - fx)/dy 209 #else: 210 # idx = (x>= qmin) & (x <=qmax) 211 # fx = numpy.asarray([self.model.run(item)for item in x[idx ]]) 212 # res= (y[idx] - fx)/dy[idx] 213 self.data.setFitRange(qmin,qmax) 214 res=self.data.residuals(self.model.runXY) 205 res=[] 206 if qmin==None and qmax==None: 207 for i in range(len(self.data.x_bins)): 208 res.append( (self.data.image[i][i]- fn([self.data.x_bins[i],self.data.y_bins[i]]))\ 209 /self.data.err_image[i][i] ) 210 211 else: 212 #idx = (x>=self.qmin) & (x <= self.qmax) 213 #fx = numpy.asarray([fn(item)for item in x[idx ]]) 214 #return (y[idx] - fx)/dy[idx] 215 for i in range(len(self.data.x_bins)): 216 res.append( (self.data.image[i][i]- fn([self.data.x_bins[i],self.data.y_bins[i]]))\ 217 /self.data.err_image[i][i] ) 218 219 215 220 sum=0 216 221 for item in res: … … 332 337 """ 333 338 334 if self.prev_group_id !=dataset. data.group_id:339 if self.prev_group_id !=dataset.group_id: 335 340 self._DataNameEnter() 336 341 self.data = dataset 337 self.prev_group_id=dataset. data.group_id342 self.prev_group_id=dataset.group_id 338 343 #Displaying Data information 339 self.DataSource.SetValue(str(dataset. data.name))340 self._xaxis,self._xunit=dataset. data.get_xaxis()344 self.DataSource.SetValue(str(dataset.name)) 345 self._xaxis,self._xunit=dataset.get_xaxis() 341 346 self.text4_3.SetLabel(self._xaxis+"["+self._xunit+"]") 342 347 self.text4_1.Show() 343 348 self.text4_2.Show() 344 349 self.text4_3.Show() 345 if not hasattr(dataset.data,'image'): 346 self.xmin.SetValue(format_number(min(dataset.data.x))) 347 self.xmin.Show() 348 self.xmax.SetValue(format_number(max(dataset.data.x))) 349 self.xmax.Show() 350 else: 351 self.xmin.SetValue(format_number(numpy.min(dataset.data.image))) 352 self.xmin.Show() 353 self.xmax.SetValue(format_number(numpy.max(dataset.data.image))) 354 self.xmax.Show() 350 351 self.xmin.SetValue(format_number(numpy.min(dataset.image))) 352 self.xmin.Show() 353 self.xmax.SetValue(format_number(numpy.max(dataset.image))) 354 self.xmax.Show() 355 355 if ((len(self.param_toFit ) >0) and self.DataSource.GetValue()and \ 356 356 self.modelbox.GetValue() and (self.model_hasChanged ==False)): -
sansview/perspectives/fitting/fitpanel.py
rbcd6d51 rcaa1226 86 86 panel.set_manager(self.manager) 87 87 panel.set_owner(self.event_owner) 88 panel.set_data_name(data) 88 89 self.nb.AddPage(page=panel,text=name,select=True) 89 90 panel.populate_box( self.model_list_box) -
sansview/perspectives/fitting/fitting.py
rbcd6d51 rcaa1226 146 146 if item.name == self.panel.graph.selected_plottable or item.__class__.__name__ is "MetaData2D": 147 147 #find a name for the page created for notebook 148 149 148 try: 150 149 page = self.fit_panel.add_fit_page(item) … … 152 151 153 152 if page !=None: 154 page.set_data_name(item)153 155 154 #create a fitproblem storing all link to data,model,page creation 156 155 self.page_finder[page]= FitProblem() 157 #data_for_park= Data(sans_data=item)158 #datap = PlottableData(data=data_for_park,data1d=item)159 #self.page_finder[page].add_data(datap)160 156 self.page_finder[page].add_data(item) 161 157 except:
Note: See TracChangeset
for help on using the changeset viewer.