source: sasview/guiframe/dataFitting.py @ e72bd95

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since e72bd95 was ff3f900b, checked in by Gervaise Alina <gervyh@…>, 15 years ago

change on data_loader

  • Property mode set to 100644
File size: 2.1 KB
Line 
1"""
2    Adapters for fitting module
3"""
4from danse.common.plottools.plottables import Data1D as PlotData1D
5from danse.common.plottools.plottables import Data2D as PlotData2D
6
7from DataLoader.data_info import Data1D as LoadData1D
8from DataLoader.data_info import Data2D as LoadData2D
9
10import copy
11
12class Data1D(PlotData1D,LoadData1D):
13   
14    def __init__(self,x=[],y=[],dx=None,dy=None):
15        PlotData1D.__init__(self, x, y, dx, dy)
16        LoadData1D.__init__(self, x, y, dx, dy)
17        self.id= None
18        self.group_id =None
19        self.is_data = True
20   
21    def copy_from_datainfo(self, data1d):
22        """
23            copy values of Data1D of type DataLaoder.Data_info
24        """
25        self.= copy.deepcopy(data1d.x)
26        self.dx = copy.deepcopy(data1d.dx)
27        self.= copy.deepcopy(data1d.y)
28        self.dy = copy.deepcopy(data1d.dy)
29        dxl = copy.deepcopy(data1d.dxl)
30        dxw = copy.deepcopy(data1d.dxw)
31   
32        self.xaxis(data1d._xaxis,data1d._xunit)
33        self.yaxis(data1d._yaxis,data1d._yunit)
34   
35   
36     
37class Data2D(PlotData2D,LoadData2D):
38    def __init__(self,image=None,err_image=None,xmin=None,xmax=None,ymin=None,ymax=None,zmin=None,zmax=None):
39       
40        PlotData2D.__init__(self, image=image, err_image=err_image,xmin=xmin, xmax=xmax,
41                            ymin=ymin, ymax=ymax)
42       
43        LoadData2D.__init__(self,data=image, err_data=err_image)
44       
45    def copy_from_datainfo(self, data2d):
46        """
47            copy value of Data2D of type DataLoader.data_info
48        """
49        self.data     =  copy.deepcopy(data2d.data)
50        self.err_data =  copy.deepcopy(data2d.err_data)
51        self.x_bins     = copy.deepcopy(data2d.x_bins)
52        self.y_bins     = copy.deepcopy(data2d.y_bins)
53       
54        self.xmin       = data2d.xmin
55        self.xmax       = data2d.xmax
56        self.ymin       = data2d.ymin
57        self.ymax       = data2d.ymax
58       
59        self.xaxis(data2d._xaxis,data2d._xunit)
60        self.yaxis(data2d._yaxis,data2d._yunit)
61       
62       
63       
Note: See TracBrowser for help on using the repository browser.