- Timestamp:
- Apr 8, 2010 4:09:07 PM (15 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:
- 286bb6c
- Parents:
- 8e87ece
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
redcbd467 r2fff4db 13 13 import time 14 14 import thread 15 16 15 from copy import deepcopy 16 17 17 from DataLoader.data_info import Data1D as LoaderData1D 18 18 from danse.common.plottools.PlotPanel import PlotPanel … … 21 21 from sans.guiframe.dataFitting import Data1D 22 22 from sans.guiframe.dataFitting import Theory1D 23 from sans.guiframe import dataFitting 23 24 24 from sans.guiframe.utils import format_number 25 25 … … 291 291 data.copy_from_datainfo(item) 292 292 item.clone_without_data(clone=data) 293 data.dy =dy293 data.dy = dy 294 294 data.name = item.name 295 295 ## allow to highlight data when plotted … … 544 544 """ 545 545 if data.__class__.__name__ != "Data2D": 546 raise Value error, " create_fittable_data2D expects a Data2D"546 raise ValueError, " create_fittable_data2D expects a Data2D" 547 547 ## Data2D case 548 548 new_data = deepcopy(data) … … 564 564 @return Data1D 565 565 """ 566 class_name = data.__class__.__name__ 567 if not class_name in ["Data1D", "Theory1D"]: 568 raise ValueError, "create_fittable_data1D expects Data1D" 569 #For prview the theory is not a subclass of DataLoader.Data1D 566 570 if not issubclass(data.__class__, LoaderData1D): 567 raise ValueError, "create_fittable_data1D expects Data1D" 571 if class_name == 'Theory1D': 572 temp_data = Theory1D(x=data.x, y=data.y, dy=data.y) 573 temp_data.copy_from_datainfo(data1d=data) 574 temp_data.name = data.name 575 if class_name == 'Data1D': 576 temp_data = Data1D(x=data.x, y=data.y, dx=data.dx, dy=data.y) 577 temp_data.copy_from_datainfo(data=data) 578 temp_data.name = data.name 579 data = temp_data 580 568 581 #get the appropriate dy 569 582 dy = deepcopy(data.dy) … … 571 584 if data.name in self.err_dy.iterkeys(): 572 585 dy = self.err_dy[data.name] 573 print "err_dy ====", dy586 574 587 if data.dy is None or data.dy == []: 575 588 dy = numpy.zeros(len(data.y)) 576 print "dy ====", dy589 #print "dy ====", dy 577 590 if data.__class__.__name__ == "Theory1D": 578 579 591 new_data = self.copy_data(data, dy) 580 new_data.group_id +="data1D"581 new_data.id +="data1D"592 new_data.group_id = str(new_data.group_id)+"data1D" 593 new_data.id = str(new_data.id)+"data1D" 582 594 new_data.is_data = False 583 595 title = new_data.name … … 731 743 Plugin.on_perspective(self,event=event) 732 744 for plottable in self.panel.graph.plottables: 733 if issubclass(plottable.__class__, LoaderData1D):745 if plottable.__class__.__name__ in ["Data1D", "Theory1D"]: 734 746 if plottable.name == self.panel.graph.selected_plottable: 735 747 data = self.create_fittable_data1D(data=plottable)
Note: See TracChangeset
for help on using the changeset viewer.