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 | |
---|
7 | from DataLoader.data_info import Data1D as LoadData1D |
---|
8 | from DataLoader.data_info import Data2D as LoadData2D |
---|
9 | |
---|
10 | import copy |
---|
11 | |
---|
12 | class 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.x = copy.deepcopy(data1d.x) |
---|
26 | self.dx = copy.deepcopy(data1d.dx) |
---|
27 | self.y = 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 | |
---|
37 | class 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 | |
---|