Changeset 6ed82c7 in sasview for sansview/perspectives/fitting
- Timestamp:
- Apr 17, 2009 2:44:58 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:
- 41340860
- Parents:
- 882a912
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r3fef0a8 r6ed82c7 7 7 from sans.guicomm.events import NewPlotEvent, StatusEvent 8 8 from sans.guicomm.events import EVT_SLICER_PANEL,ERR_DATA 9 9 from sans.guiframe import dataFitting 10 10 from sans.fit.AbstractFitEngine import Model,FitData1D,FitData2D 11 11 12 from fitproblem import FitProblem 12 13 from fitpanel import FitPanel … … 14 15 import models 15 16 import fitpage 17 16 18 17 19 DEFAULT_BEAM = 0.005 … … 254 256 255 257 from sans.guiframe import dataFitting 256 if item.__class__.__name__=="Data1D": 257 data= dataFitting.Data1D(x=item.x, y=item.y, dy=dy, dxl=dxl, dxw=dxw) 258 else: 259 data= dataFitting.Theory1D(x=item.x, y=item.y, dxl=dxl, dxw=dxw) 258 259 data= dataFitting.Data1D(x=item.x, y=item.y, dy=dy, dxl=dxl, dxw=dxw) 260 260 261 data.name = item.name 261 262 data.detector = detector … … 268 269 ## to save data 1D as cansas xml file 269 270 data.info= info 271 is_data=False 272 if hasattr(item, "is_data"): 273 is_data= item.is_data 274 data.is_data = is_data 270 275 ## If the data file does not tell us what the axes are, just assume... 271 276 data.xaxis(copy.deepcopy(item._xaxis),copy.deepcopy(item._xunit)) … … 561 566 """ 562 567 self.panel = event.GetEventObject() 563 for item in self.panel.graph.plottables: 564 565 if item.name == self.panel.graph.selected_plottable: 568 for plottable in self.panel.graph.plottables: 569 570 if plottable.name == self.panel.graph.selected_plottable: 571 if not hasattr(plottable, "is_data")or \ 572 plottable.__class__.__name__=="Theory1D": 573 dy=numpy.zeros(len(plottable.y)) 574 if hasattr(plottable, "dy"): 575 dy= copy.deepcopy(plottable.dy) 576 item= self.copy_data(plottable, dy) 577 item.group_id += "data1D" 578 item.id +="data1D" 579 item.is_data= False 580 title = item.name 581 wx.PostEvent(self.parent, NewPlotEvent(plot=item, title=str(title))) 582 else: 583 item= copy.deepcopy(plottable) 566 584 ## put the errors values back to the model if the errors were hiden 567 585 ## before sending them to the fit engine … … 579 597 data= copy.deepcopy(item) 580 598 else: 581 data= copy.deepcopy(item) 599 ## Data2D case 600 if not hasattr(plottable, "is_data"): 601 item= copy.deepcopy(plottable) 602 item.group_id += "data2D" 603 item.id +="data2D" 604 item.is_data= False 605 title = item.name 606 title += " Fit" 607 data = item 608 wx.PostEvent(self.parent, NewPlotEvent(plot=item, title=str(title))) 609 else: 610 item= copy.deepcopy(plottable ) 611 data= copy.deepcopy(plottable ) 582 612 ## create anew page 583 613 if item.name == self.panel.graph.selected_plottable or\ … … 588 618 if page !=None: 589 619 #create a fitproblem storing all link to data,model,page creation 590 self.page_finder[page]= FitProblem() 620 if not page in self.page_finder.keys(): 621 self.page_finder[page]= FitProblem() 591 622 ## item is almost the same as data but contains 592 623 ## axis info for plotting … … 930 961 title= my_info.title 931 962 if title== None: 932 title ="Analytical model 1D "963 title = "Analytical model 1D " 933 964 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 934 965 title= str(title), reset=True )) … … 984 1015 theory.xmin= data.xmin 985 1016 theory.xmax= data.xmax 1017 print "model comptele plot",theory.xmin,theory.xmax,theory.ymin,theory.ymin 986 1018 987 1019 ## plot
Note: See TracChangeset
for help on using the changeset viewer.