1 | """ |
---|
2 | Adapters for fitting module |
---|
3 | """ |
---|
4 | from danse.common.plottools.plottables import Data1D as PlotData1D |
---|
5 | from danse.common.plottools.plottables import Data2D as PlotData2D |
---|
6 | from danse.common.plottools.plottables import Theory1D as PlotTheory1D |
---|
7 | |
---|
8 | from DataLoader.data_info import Data1D as LoadData1D |
---|
9 | from DataLoader.data_info import Data2D as LoadData2D |
---|
10 | |
---|
11 | import copy |
---|
12 | |
---|
13 | class Data1D(PlotData1D,LoadData1D): |
---|
14 | |
---|
15 | def __init__(self,x=[],y=[],dx=None,dy=None): |
---|
16 | PlotData1D.__init__(self, x, y, dx, dy) |
---|
17 | LoadData1D.__init__(self, x, y, dx, dy) |
---|
18 | self.id= None |
---|
19 | self.group_id =None |
---|
20 | self.is_data = True |
---|
21 | |
---|
22 | def copy_from_datainfo(self, data1d): |
---|
23 | """ |
---|
24 | copy values of Data1D of type DataLaoder.Data_info |
---|
25 | """ |
---|
26 | self.x = copy.deepcopy(data1d.x) |
---|
27 | self.dx = copy.deepcopy(data1d.dx) |
---|
28 | self.y = copy.deepcopy(data1d.y) |
---|
29 | self.dy = copy.deepcopy(data1d.dy) |
---|
30 | dxl = copy.deepcopy(data1d.dxl) |
---|
31 | dxw = copy.deepcopy(data1d.dxw) |
---|
32 | |
---|
33 | self.xaxis(data1d._xaxis,data1d._xunit) |
---|
34 | self.yaxis(data1d._yaxis,data1d._yunit) |
---|
35 | |
---|
36 | class Theory1D(PlotTheory1D,LoadData1D): |
---|
37 | |
---|
38 | def __init__(self,x=[],y=[],dy=None): |
---|
39 | PlotTheory1D.__init__(self, x, y, dy) |
---|
40 | LoadData1D.__init__(self, x, y, dy) |
---|
41 | self.id= None |
---|
42 | self.group_id =None |
---|
43 | self.is_data = True |
---|
44 | |
---|
45 | def copy_from_datainfo(self, data1d): |
---|
46 | """ |
---|
47 | copy values of Data1D of type DataLaoder.Data_info |
---|
48 | """ |
---|
49 | self.x = copy.deepcopy(data1d.x) |
---|
50 | self.y = copy.deepcopy(data1d.y) |
---|
51 | self.dy = copy.deepcopy(data1d.dy) |
---|
52 | |
---|
53 | self.xaxis(data1d._xaxis,data1d._xunit) |
---|
54 | self.yaxis(data1d._yaxis,data1d._yunit) |
---|
55 | |
---|
56 | class Data2D(PlotData2D,LoadData2D): |
---|
57 | def __init__(self,image=None,err_image=None,xmin=None,xmax=None,ymin=None,ymax=None,zmin=None,zmax=None): |
---|
58 | |
---|
59 | PlotData2D.__init__(self, image=image, err_image=err_image,xmin=xmin, xmax=xmax, |
---|
60 | ymin=ymin, ymax=ymax) |
---|
61 | |
---|
62 | LoadData2D.__init__(self,data=image, err_data=err_image) |
---|
63 | |
---|
64 | def copy_from_datainfo(self, data2d): |
---|
65 | """ |
---|
66 | copy value of Data2D of type DataLoader.data_info |
---|
67 | """ |
---|
68 | self.data = copy.deepcopy(data2d.data) |
---|
69 | self.err_data = copy.deepcopy(data2d.err_data) |
---|
70 | self.x_bins = copy.deepcopy(data2d.x_bins) |
---|
71 | self.y_bins = copy.deepcopy(data2d.y_bins) |
---|
72 | |
---|
73 | self.xmin = data2d.xmin |
---|
74 | self.xmax = data2d.xmax |
---|
75 | self.ymin = data2d.ymin |
---|
76 | self.ymax = data2d.ymax |
---|
77 | |
---|
78 | self.xaxis(data2d._xaxis,data2d._xunit) |
---|
79 | self.yaxis(data2d._yaxis,data2d._yunit) |
---|
80 | |
---|
81 | |
---|
82 | |
---|