The requested changes are too big and content was truncated. Show full diff
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file | ||
The requested commit or file is too big and content was truncated. Show full diff |
@@ -1,528 +1,528 | |||||
1 | from PyQt4 import QtCore, QtGui |
|
1 | from PyQt4 import QtCore, QtGui | |
2 |
|
2 | |||
3 | try: |
|
3 | try: | |
4 | _fromUtf8 = QtCore.QString.fromUtf8 |
|
4 | _fromUtf8 = QtCore.QString.fromUtf8 | |
5 | except AttributeError: |
|
5 | except AttributeError: | |
6 | def _fromUtf8(s): |
|
6 | def _fromUtf8(s): | |
7 | return s |
|
7 | return s | |
8 |
|
8 | |||
9 | try: |
|
9 | try: | |
10 | _encoding = QtGui.QApplication.UnicodeUTF8 |
|
10 | _encoding = QtGui.QApplication.UnicodeUTF8 | |
11 | def _translate(context, text, disambig): |
|
11 | def _translate(context, text, disambig): | |
12 | return QtGui.QApplication.translate(context, text, disambig, _encoding) |
|
12 | return QtGui.QApplication.translate(context, text, disambig, _encoding) | |
13 | except AttributeError: |
|
13 | except AttributeError: | |
14 | def _translate(context, text, disambig): |
|
14 | def _translate(context, text, disambig): | |
15 | return QtGui.QApplication.translate(context, text, disambig) |
|
15 | return QtGui.QApplication.translate(context, text, disambig) | |
16 |
|
16 | |||
17 | class Ui_SpectraTab(object): |
|
17 | class Ui_SpectraTab(object): | |
18 |
|
18 | |||
19 | def setupUi(self): |
|
19 | def setupUi(self): | |
20 |
|
20 | |||
21 | self.tabSpectra = QtGui.QWidget() |
|
21 | self.tabSpectra = QtGui.QWidget() | |
22 | self.tabSpectra.setObjectName(_fromUtf8("tabSpectra")) |
|
22 | self.tabSpectra.setObjectName(_fromUtf8("tabSpectra")) | |
23 | self.gridLayout_7 = QtGui.QGridLayout(self.tabSpectra) |
|
23 | self.gridLayout_7 = QtGui.QGridLayout(self.tabSpectra) | |
24 | self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) |
|
24 | self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) | |
25 | self.frame_5 = QtGui.QFrame(self.tabSpectra) |
|
25 | self.frame_5 = QtGui.QFrame(self.tabSpectra) | |
26 | self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel) |
|
26 | self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel) | |
27 | self.frame_5.setFrameShadow(QtGui.QFrame.Raised) |
|
27 | self.frame_5.setFrameShadow(QtGui.QFrame.Raised) | |
28 | self.frame_5.setObjectName(_fromUtf8("frame_5")) |
|
28 | self.frame_5.setObjectName(_fromUtf8("frame_5")) | |
29 | self.gridLayout_18 = QtGui.QGridLayout(self.frame_5) |
|
29 | self.gridLayout_18 = QtGui.QGridLayout(self.frame_5) | |
30 | self.gridLayout_18.setObjectName(_fromUtf8("gridLayout_18")) |
|
30 | self.gridLayout_18.setObjectName(_fromUtf8("gridLayout_18")) | |
31 |
|
31 | |||
32 | self.specOpOk = QtGui.QPushButton(self.frame_5) |
|
32 | self.specOpOk = QtGui.QPushButton(self.frame_5) | |
33 | self.specOpOk.setObjectName(_fromUtf8("specOpOk")) |
|
33 | self.specOpOk.setObjectName(_fromUtf8("specOpOk")) | |
34 | self.gridLayout_18.addWidget(self.specOpOk, 0, 0, 1, 1) |
|
34 | self.gridLayout_18.addWidget(self.specOpOk, 0, 0, 1, 1) | |
35 |
|
35 | |||
36 | self.specGraphClear = QtGui.QPushButton(self.frame_5) |
|
36 | self.specGraphClear = QtGui.QPushButton(self.frame_5) | |
37 | self.specGraphClear.setObjectName(_fromUtf8("specGraphClear")) |
|
37 | self.specGraphClear.setObjectName(_fromUtf8("specGraphClear")) | |
38 | self.gridLayout_18.addWidget(self.specGraphClear, 0, 1, 1, 1) |
|
38 | self.gridLayout_18.addWidget(self.specGraphClear, 0, 1, 1, 1) | |
39 |
|
39 | |||
40 | self.gridLayout_7.addWidget(self.frame_5, 1, 1, 1, 1) |
|
40 | self.gridLayout_7.addWidget(self.frame_5, 1, 1, 1, 1) | |
41 |
|
41 | |||
42 | self.tabWidgetSpectra = QtGui.QTabWidget(self.tabSpectra) |
|
42 | self.tabWidgetSpectra = QtGui.QTabWidget(self.tabSpectra) | |
43 | self.tabWidgetSpectra.setObjectName(_fromUtf8("tabWidgetSpectra")) |
|
43 | self.tabWidgetSpectra.setObjectName(_fromUtf8("tabWidgetSpectra")) | |
44 |
|
44 | |||
45 | self.tabopSpectra = QtGui.QWidget() |
|
45 | self.tabopSpectra = QtGui.QWidget() | |
46 | self.tabopSpectra.setObjectName(_fromUtf8("tabopSpectra")) |
|
46 | self.tabopSpectra.setObjectName(_fromUtf8("tabopSpectra")) | |
47 |
|
47 | |||
48 | self.gridLayout_5 = QtGui.QGridLayout(self.tabopSpectra) |
|
48 | self.gridLayout_5 = QtGui.QGridLayout(self.tabopSpectra) | |
49 | self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) |
|
49 | self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) | |
50 |
|
50 | |||
51 |
|
51 | |||
52 |
|
52 | |||
53 | self.specOpCebRadarfrequency = QtGui.QCheckBox(self.tabopSpectra) |
|
53 | self.specOpCebRadarfrequency = QtGui.QCheckBox(self.tabopSpectra) | |
54 | self.specOpCebRadarfrequency.setObjectName(_fromUtf8("specOpCebRadarfrequency")) |
|
54 | self.specOpCebRadarfrequency.setObjectName(_fromUtf8("specOpCebRadarfrequency")) | |
55 | self.gridLayout_5.addWidget(self.specOpCebRadarfrequency, 0, 0, 1, 1) |
|
55 | self.gridLayout_5.addWidget(self.specOpCebRadarfrequency, 0, 0, 1, 1) | |
56 |
|
56 | |||
57 | self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra) |
|
57 | self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra) | |
58 | self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency")) |
|
58 | self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency")) | |
59 | self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 1, 1, 4) |
|
59 | self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 1, 1, 4) | |
60 |
|
60 | |||
61 |
|
61 | |||
62 | self.specLabProfiles = QtGui.QLabel(self.tabopSpectra) |
|
62 | self.specLabProfiles = QtGui.QLabel(self.tabopSpectra) | |
63 | self.specLabProfiles.setObjectName(_fromUtf8("specLabProfiles")) |
|
63 | self.specLabProfiles.setObjectName(_fromUtf8("specLabProfiles")) | |
64 | self.gridLayout_5.addWidget(self.specLabProfiles, 1, 0, 1, 1) |
|
64 | self.gridLayout_5.addWidget(self.specLabProfiles, 1, 0, 1, 1) | |
65 |
|
65 | |||
66 | self.specOpProfiles = QtGui.QLineEdit(self.tabopSpectra) |
|
66 | self.specOpProfiles = QtGui.QLineEdit(self.tabopSpectra) | |
67 | self.specOpProfiles.setObjectName(_fromUtf8("specOpProfiles")) |
|
67 | self.specOpProfiles.setObjectName(_fromUtf8("specOpProfiles")) | |
68 | self.gridLayout_5.addWidget(self.specOpProfiles, 1, 1, 1, 4) |
|
68 | self.gridLayout_5.addWidget(self.specOpProfiles, 1, 1, 1, 4) | |
69 |
|
69 | |||
70 |
|
70 | |||
71 | self.specLabnFFTPoints = QtGui.QLabel(self.tabopSpectra) |
|
71 | self.specLabnFFTPoints = QtGui.QLabel(self.tabopSpectra) | |
72 | self.specLabnFFTPoints.setObjectName(_fromUtf8("specLabnFFTPoints")) |
|
72 | self.specLabnFFTPoints.setObjectName(_fromUtf8("specLabnFFTPoints")) | |
73 | self.gridLayout_5.addWidget(self.specLabnFFTPoints, 2, 0, 1, 1) |
|
73 | self.gridLayout_5.addWidget(self.specLabnFFTPoints, 2, 0, 1, 1) | |
74 |
|
74 | |||
75 | self.specOpnFFTpoints = QtGui.QLineEdit(self.tabopSpectra) |
|
75 | self.specOpnFFTpoints = QtGui.QLineEdit(self.tabopSpectra) | |
76 | self.specOpnFFTpoints.setObjectName(_fromUtf8("specOpnFFTpoints")) |
|
76 | self.specOpnFFTpoints.setObjectName(_fromUtf8("specOpnFFTpoints")) | |
77 | self.gridLayout_5.addWidget(self.specOpnFFTpoints, 2, 1, 1, 4) |
|
77 | self.gridLayout_5.addWidget(self.specOpnFFTpoints, 2, 1, 1, 4) | |
78 |
|
78 | |||
79 |
|
79 | |||
80 | self.specLabippFactor = QtGui.QLabel(self.tabopSpectra) |
|
80 | self.specLabippFactor = QtGui.QLabel(self.tabopSpectra) | |
81 | self.specLabippFactor.setObjectName(_fromUtf8("specLabippFactor")) |
|
81 | self.specLabippFactor.setObjectName(_fromUtf8("specLabippFactor")) | |
82 | self.gridLayout_5.addWidget(self.specLabippFactor, 3, 0, 1, 1) |
|
82 | self.gridLayout_5.addWidget(self.specLabippFactor, 3, 0, 1, 1) | |
83 |
|
83 | |||
84 | self.specOpippFactor = QtGui.QLineEdit(self.tabopSpectra) |
|
84 | self.specOpippFactor = QtGui.QLineEdit(self.tabopSpectra) | |
85 | self.specOpippFactor.setObjectName(_fromUtf8("specOpippFactor")) |
|
85 | self.specOpippFactor.setObjectName(_fromUtf8("specOpippFactor")) | |
86 | self.gridLayout_5.addWidget(self.specOpippFactor, 3, 1, 1, 4) |
|
86 | self.gridLayout_5.addWidget(self.specOpippFactor, 3, 1, 1, 4) | |
87 |
|
87 | |||
88 |
|
88 | |||
89 | self.specOpCebChannel = QtGui.QCheckBox(self.tabopSpectra) |
|
89 | self.specOpCebChannel = QtGui.QCheckBox(self.tabopSpectra) | |
90 | self.specOpCebChannel.setObjectName(_fromUtf8("specOpCebChannel")) |
|
90 | self.specOpCebChannel.setObjectName(_fromUtf8("specOpCebChannel")) | |
91 | self.gridLayout_5.addWidget(self.specOpCebChannel, 4, 0, 1, 1) |
|
91 | self.gridLayout_5.addWidget(self.specOpCebChannel, 4, 0, 1, 1) | |
92 |
|
92 | |||
93 | self.specOpComChannel = QtGui.QComboBox(self.tabopSpectra) |
|
93 | self.specOpComChannel = QtGui.QComboBox(self.tabopSpectra) | |
94 | self.specOpComChannel.setObjectName(_fromUtf8("specOpComChannel")) |
|
94 | self.specOpComChannel.setObjectName(_fromUtf8("specOpComChannel")) | |
95 | self.specOpComChannel.addItem(_fromUtf8("")) |
|
95 | self.specOpComChannel.addItem(_fromUtf8("")) | |
96 | self.specOpComChannel.addItem(_fromUtf8("")) |
|
96 | self.specOpComChannel.addItem(_fromUtf8("")) | |
97 | self.gridLayout_5.addWidget(self.specOpComChannel, 4, 1, 1, 2) |
|
97 | self.gridLayout_5.addWidget(self.specOpComChannel, 4, 1, 1, 2) | |
98 |
|
98 | |||
99 | self.specOpChannel = QtGui.QLineEdit(self.tabopSpectra) |
|
99 | self.specOpChannel = QtGui.QLineEdit(self.tabopSpectra) | |
100 | self.specOpChannel.setObjectName(_fromUtf8("specOpChannel")) |
|
100 | self.specOpChannel.setObjectName(_fromUtf8("specOpChannel")) | |
101 | self.gridLayout_5.addWidget(self.specOpChannel, 4, 3, 1, 2) |
|
101 | self.gridLayout_5.addWidget(self.specOpChannel, 4, 3, 1, 2) | |
102 |
|
102 | |||
103 |
|
103 | |||
104 | self.specOpCebCrossSpectra = QtGui.QCheckBox(self.tabopSpectra) |
|
104 | self.specOpCebCrossSpectra = QtGui.QCheckBox(self.tabopSpectra) | |
105 | self.specOpCebCrossSpectra.setObjectName(_fromUtf8("specOpCebCrossSpectra")) |
|
105 | self.specOpCebCrossSpectra.setObjectName(_fromUtf8("specOpCebCrossSpectra")) | |
106 | self.gridLayout_5.addWidget(self.specOpCebCrossSpectra, 5, 0, 1, 1) |
|
106 | self.gridLayout_5.addWidget(self.specOpCebCrossSpectra, 5, 0, 1, 1) | |
107 |
|
107 | |||
108 | self.specOpComCrossSpectra = QtGui.QComboBox(self.tabopSpectra) |
|
108 | self.specOpComCrossSpectra = QtGui.QComboBox(self.tabopSpectra) | |
109 | self.specOpComCrossSpectra.setObjectName(_fromUtf8("specOpComCrossSpectra")) |
|
109 | self.specOpComCrossSpectra.setObjectName(_fromUtf8("specOpComCrossSpectra")) | |
110 | self.specOpComCrossSpectra.addItem(_fromUtf8("")) |
|
110 | self.specOpComCrossSpectra.addItem(_fromUtf8("")) | |
111 | self.gridLayout_5.addWidget(self.specOpComCrossSpectra, 5, 1, 1, 2) |
|
111 | self.gridLayout_5.addWidget(self.specOpComCrossSpectra, 5, 1, 1, 2) | |
112 |
|
112 | |||
113 | self.specOppairsList = QtGui.QLineEdit(self.tabopSpectra) |
|
113 | self.specOppairsList = QtGui.QLineEdit(self.tabopSpectra) | |
114 | self.specOppairsList.setObjectName(_fromUtf8("specOppairsList")) |
|
114 | self.specOppairsList.setObjectName(_fromUtf8("specOppairsList")) | |
115 | self.gridLayout_5.addWidget(self.specOppairsList, 5, 3, 1, 2) |
|
115 | self.gridLayout_5.addWidget(self.specOppairsList, 5, 3, 1, 2) | |
116 |
|
116 | |||
117 |
|
117 | |||
118 | self.specOpCebHeights = QtGui.QCheckBox(self.tabopSpectra) |
|
118 | self.specOpCebHeights = QtGui.QCheckBox(self.tabopSpectra) | |
119 | self.specOpCebHeights.setObjectName(_fromUtf8("specOpCebHeights")) |
|
119 | self.specOpCebHeights.setObjectName(_fromUtf8("specOpCebHeights")) | |
120 | self.gridLayout_5.addWidget(self.specOpCebHeights, 6, 0, 1, 1) |
|
120 | self.gridLayout_5.addWidget(self.specOpCebHeights, 6, 0, 1, 1) | |
121 |
|
121 | |||
122 | self.specOpComHeights = QtGui.QComboBox(self.tabopSpectra) |
|
122 | self.specOpComHeights = QtGui.QComboBox(self.tabopSpectra) | |
123 | self.specOpComHeights.setObjectName(_fromUtf8("specOpComHeights")) |
|
123 | self.specOpComHeights.setObjectName(_fromUtf8("specOpComHeights")) | |
124 | self.specOpComHeights.addItem(_fromUtf8("")) |
|
124 | self.specOpComHeights.addItem(_fromUtf8("")) | |
125 | self.specOpComHeights.addItem(_fromUtf8("")) |
|
125 | self.specOpComHeights.addItem(_fromUtf8("")) | |
126 | self.gridLayout_5.addWidget(self.specOpComHeights, 6, 1, 1, 2) |
|
126 | self.gridLayout_5.addWidget(self.specOpComHeights, 6, 1, 1, 2) | |
127 |
|
127 | |||
128 | self.specOpHeights = QtGui.QLineEdit(self.tabopSpectra) |
|
128 | self.specOpHeights = QtGui.QLineEdit(self.tabopSpectra) | |
129 | self.specOpHeights.setObjectName(_fromUtf8("specOpHeights")) |
|
129 | self.specOpHeights.setObjectName(_fromUtf8("specOpHeights")) | |
130 | self.gridLayout_5.addWidget(self.specOpHeights, 6, 3, 1, 2) |
|
130 | self.gridLayout_5.addWidget(self.specOpHeights, 6, 3, 1, 2) | |
131 |
|
131 | |||
132 |
|
132 | |||
133 | self.specOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectra) |
|
133 | self.specOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectra) | |
134 | self.specOpCebIncoherent.setObjectName(_fromUtf8("specOpCebIncoherent")) |
|
134 | self.specOpCebIncoherent.setObjectName(_fromUtf8("specOpCebIncoherent")) | |
135 | self.gridLayout_5.addWidget(self.specOpCebIncoherent, 7, 0, 1, 1) |
|
135 | self.gridLayout_5.addWidget(self.specOpCebIncoherent, 7, 0, 1, 1) | |
136 |
|
136 | |||
137 | self.specOpCobIncInt = QtGui.QComboBox(self.tabopSpectra) |
|
137 | self.specOpCobIncInt = QtGui.QComboBox(self.tabopSpectra) | |
138 | self.specOpCobIncInt.setObjectName(_fromUtf8("specOpCobIncInt")) |
|
138 | self.specOpCobIncInt.setObjectName(_fromUtf8("specOpCobIncInt")) | |
139 | self.specOpCobIncInt.addItem(_fromUtf8("")) |
|
139 | self.specOpCobIncInt.addItem(_fromUtf8("")) | |
140 | self.specOpCobIncInt.addItem(_fromUtf8("")) |
|
140 | self.specOpCobIncInt.addItem(_fromUtf8("")) | |
141 | self.gridLayout_5.addWidget(self.specOpCobIncInt, 7, 1, 1, 2) |
|
141 | self.gridLayout_5.addWidget(self.specOpCobIncInt, 7, 1, 1, 2) | |
142 |
|
142 | |||
143 | self.specOpIncoherent = QtGui.QLineEdit(self.tabopSpectra) |
|
143 | self.specOpIncoherent = QtGui.QLineEdit(self.tabopSpectra) | |
144 | self.specOpIncoherent.setObjectName(_fromUtf8("specOpIncoherent")) |
|
144 | self.specOpIncoherent.setObjectName(_fromUtf8("specOpIncoherent")) | |
145 | self.gridLayout_5.addWidget(self.specOpIncoherent, 7, 3, 1, 2) |
|
145 | self.gridLayout_5.addWidget(self.specOpIncoherent, 7, 3, 1, 2) | |
146 |
|
146 | |||
147 |
|
147 | |||
148 | self.specOpCebRemoveDC = QtGui.QCheckBox(self.tabopSpectra) |
|
148 | self.specOpCebRemoveDC = QtGui.QCheckBox(self.tabopSpectra) | |
149 | self.specOpCebRemoveDC.setObjectName(_fromUtf8("specOpCebRemoveDC")) |
|
149 | self.specOpCebRemoveDC.setObjectName(_fromUtf8("specOpCebRemoveDC")) | |
150 | self.gridLayout_5.addWidget(self.specOpCebRemoveDC, 8, 0, 1, 1) |
|
150 | self.gridLayout_5.addWidget(self.specOpCebRemoveDC, 8, 0, 1, 1) | |
151 |
|
151 | |||
152 | self.specOpComRemoveDC = QtGui.QComboBox(self.tabopSpectra) |
|
152 | self.specOpComRemoveDC = QtGui.QComboBox(self.tabopSpectra) | |
153 | self.specOpComRemoveDC.setObjectName(_fromUtf8("specOpComRemoveDC")) |
|
153 | self.specOpComRemoveDC.setObjectName(_fromUtf8("specOpComRemoveDC")) | |
154 | self.specOpComRemoveDC.addItem(_fromUtf8("")) |
|
154 | self.specOpComRemoveDC.addItem(_fromUtf8("")) | |
155 | self.specOpComRemoveDC.addItem(_fromUtf8("")) |
|
155 | self.specOpComRemoveDC.addItem(_fromUtf8("")) | |
156 | self.gridLayout_5.addWidget(self.specOpComRemoveDC, 8, 1, 1, 2) |
|
156 | self.gridLayout_5.addWidget(self.specOpComRemoveDC, 8, 1, 1, 2) | |
157 |
|
157 | |||
158 |
|
158 | |||
159 | self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra) |
|
159 | self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra) | |
160 | self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt")) |
|
160 | self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt")) | |
161 | self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 9, 0, 1, 1) |
|
161 | self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 9, 0, 1, 1) | |
162 |
|
162 | |||
163 |
|
163 | |||
164 | self.specOpCebgetNoise = QtGui.QCheckBox(self.tabopSpectra) |
|
164 | self.specOpCebgetNoise = QtGui.QCheckBox(self.tabopSpectra) | |
165 | self.specOpCebgetNoise.setObjectName(_fromUtf8("specOpCebgetNoise")) |
|
165 | self.specOpCebgetNoise.setObjectName(_fromUtf8("specOpCebgetNoise")) | |
166 | self.gridLayout_5.addWidget(self.specOpCebgetNoise, 10, 0, 1, 1) |
|
166 | self.gridLayout_5.addWidget(self.specOpCebgetNoise, 10, 0, 1, 1) | |
167 |
|
167 | |||
168 | self.specOpgetNoise = QtGui.QLineEdit(self.tabopSpectra) |
|
168 | self.specOpgetNoise = QtGui.QLineEdit(self.tabopSpectra) | |
169 | self.specOpgetNoise.setObjectName(_fromUtf8("specOpgetNoise")) |
|
169 | self.specOpgetNoise.setObjectName(_fromUtf8("specOpgetNoise")) | |
170 | self.gridLayout_5.addWidget(self.specOpgetNoise, 10, 1, 1, 4) |
|
170 | self.gridLayout_5.addWidget(self.specOpgetNoise, 10, 1, 1, 4) | |
171 |
|
171 | |||
172 | # spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
172 | # spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
173 | # self.gridLayout_5.addItem(spacerItem9, 12, 3, 1, 1) |
|
173 | # self.gridLayout_5.addItem(spacerItem9, 12, 3, 1, 1) | |
174 | # |
|
174 | # | |
175 | # spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
175 | # spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
176 | # self.gridLayout_5.addItem(spacerItem10, 9, 3, 1, 1) |
|
176 | # self.gridLayout_5.addItem(spacerItem10, 9, 3, 1, 1) | |
177 | # |
|
177 | # | |
178 | # spacerItem11 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
178 | # spacerItem11 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
179 | # self.gridLayout_5.addItem(spacerItem11, 7, 3, 1, 1) |
|
179 | # self.gridLayout_5.addItem(spacerItem11, 7, 3, 1, 1) | |
180 | # |
|
180 | # | |
181 | # spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
181 | # spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
182 | # self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1) |
|
182 | # self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1) | |
183 | # |
|
183 | # | |
184 | # spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
184 | # spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
185 | # self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1) |
|
185 | # self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1) | |
186 |
|
186 | |||
187 |
|
187 | |||
188 | self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8("")) |
|
188 | self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8("")) | |
189 |
|
189 | |||
190 | ################################################################ |
|
190 | ################################################################ | |
191 | ################################################################ |
|
191 | ################################################################ | |
192 |
|
192 | |||
193 | self.tabgraphSpectra = QtGui.QWidget() |
|
193 | self.tabgraphSpectra = QtGui.QWidget() | |
194 | self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra")) |
|
194 | self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra")) | |
195 | self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra) |
|
195 | self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra) | |
196 | self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) |
|
196 | self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) | |
197 |
|
197 | |||
198 | # spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
198 | # spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
199 | # self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) |
|
199 | # self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) | |
200 | xi = 0 |
|
200 | xi = 0 | |
201 |
|
201 | |||
202 | self.label_24 = QtGui.QLabel(self.tabgraphSpectra) |
|
202 | self.label_24 = QtGui.QLabel(self.tabgraphSpectra) | |
203 | self.label_24.setObjectName(_fromUtf8("label_24")) |
|
203 | self.label_24.setObjectName(_fromUtf8("label_24")) | |
204 | self.gridLayout_9.addWidget(self.label_24, xi, 0, 1, 1) |
|
204 | self.gridLayout_9.addWidget(self.label_24, xi, 0, 1, 1) | |
205 |
|
205 | |||
206 | self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra) |
|
206 | self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra) | |
207 | self.specGraphPath.setObjectName(_fromUtf8("specGraphPath")) |
|
207 | self.specGraphPath.setObjectName(_fromUtf8("specGraphPath")) | |
208 | self.gridLayout_9.addWidget(self.specGraphPath, xi, 1, 1, 6) |
|
208 | self.gridLayout_9.addWidget(self.specGraphPath, xi, 1, 1, 6) | |
209 |
|
209 | |||
210 | self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra) |
|
210 | self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra) | |
211 | self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath")) |
|
211 | self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath")) | |
212 | self.gridLayout_9.addWidget(self.specGraphToolPath, xi, 7, 1, 1) |
|
212 | self.gridLayout_9.addWidget(self.specGraphToolPath, xi, 7, 1, 1) | |
213 |
|
213 | |||
214 | self.label_25 = QtGui.QLabel(self.tabgraphSpectra) |
|
214 | self.label_25 = QtGui.QLabel(self.tabgraphSpectra) | |
215 | self.label_25.setObjectName(_fromUtf8("label_25")) |
|
215 | self.label_25.setObjectName(_fromUtf8("label_25")) | |
216 | self.gridLayout_9.addWidget(self.label_25, xi+1, 0, 1, 1) |
|
216 | self.gridLayout_9.addWidget(self.label_25, xi+1, 0, 1, 1) | |
217 | self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra) |
|
217 | self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra) | |
218 | self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix")) |
|
218 | self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix")) | |
219 | self.gridLayout_9.addWidget(self.specGraphPrefix, xi+1, 1, 1, 7) |
|
219 | self.gridLayout_9.addWidget(self.specGraphPrefix, xi+1, 1, 1, 7) | |
220 |
|
220 | |||
221 | xi = 2 |
|
221 | xi = 2 | |
222 |
|
222 | |||
223 | self.label_40 = QtGui.QLabel(self.tabgraphSpectra) |
|
223 | self.label_40 = QtGui.QLabel(self.tabgraphSpectra) | |
224 | self.label_40.setObjectName(_fromUtf8("label_40")) |
|
224 | self.label_40.setObjectName(_fromUtf8("label_40")) | |
225 | self.gridLayout_9.addWidget(self.label_40, xi+1, 0, 1, 1) |
|
225 | self.gridLayout_9.addWidget(self.label_40, xi+1, 0, 1, 1) | |
226 | self.label_41 = QtGui.QLabel(self.tabgraphSpectra) |
|
226 | self.label_41 = QtGui.QLabel(self.tabgraphSpectra) | |
227 | self.label_41.setObjectName(_fromUtf8("label_41")) |
|
227 | self.label_41.setObjectName(_fromUtf8("label_41")) | |
228 | self.gridLayout_9.addWidget(self.label_41, xi+2, 0, 1, 1) |
|
228 | self.gridLayout_9.addWidget(self.label_41, xi+2, 0, 1, 1) | |
229 | self.label_42 = QtGui.QLabel(self.tabgraphSpectra) |
|
229 | self.label_42 = QtGui.QLabel(self.tabgraphSpectra) | |
230 | self.label_42.setObjectName(_fromUtf8("label_42")) |
|
230 | self.label_42.setObjectName(_fromUtf8("label_42")) | |
231 | self.gridLayout_9.addWidget(self.label_42, xi+3, 0, 1, 1) |
|
231 | self.gridLayout_9.addWidget(self.label_42, xi+3, 0, 1, 1) | |
232 | self.label_44 = QtGui.QLabel(self.tabgraphSpectra) |
|
232 | self.label_44 = QtGui.QLabel(self.tabgraphSpectra) | |
233 | self.label_44.setObjectName(_fromUtf8("label_44")) |
|
233 | self.label_44.setObjectName(_fromUtf8("label_44")) | |
234 | self.gridLayout_9.addWidget(self.label_44, xi+4, 0, 1, 1) |
|
234 | self.gridLayout_9.addWidget(self.label_44, xi+4, 0, 1, 1) | |
235 | self.label_46 = QtGui.QLabel(self.tabgraphSpectra) |
|
235 | self.label_46 = QtGui.QLabel(self.tabgraphSpectra) | |
236 | self.label_46.setObjectName(_fromUtf8("label_46")) |
|
236 | self.label_46.setObjectName(_fromUtf8("label_46")) | |
237 | self.gridLayout_9.addWidget(self.label_46, xi+5, 0, 1, 1) |
|
237 | self.gridLayout_9.addWidget(self.label_46, xi+5, 0, 1, 1) | |
238 | self.label_45 = QtGui.QLabel(self.tabgraphSpectra) |
|
238 | self.label_45 = QtGui.QLabel(self.tabgraphSpectra) | |
239 | self.label_45.setObjectName(_fromUtf8("label_45")) |
|
239 | self.label_45.setObjectName(_fromUtf8("label_45")) | |
240 | self.gridLayout_9.addWidget(self.label_45, xi+6, 0, 1, 1) |
|
240 | self.gridLayout_9.addWidget(self.label_45, xi+6, 0, 1, 1) | |
241 |
|
241 | |||
242 | self.label_43 = QtGui.QLabel(self.tabgraphSpectra) |
|
242 | self.label_43 = QtGui.QLabel(self.tabgraphSpectra) | |
243 | self.label_43.setObjectName(_fromUtf8("label_43")) |
|
243 | self.label_43.setObjectName(_fromUtf8("label_43")) | |
244 | self.gridLayout_9.addWidget(self.label_43, xi, 3, 1, 1) |
|
244 | self.gridLayout_9.addWidget(self.label_43, xi, 3, 1, 1) | |
245 | self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
245 | self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
246 | self.specGraphCebSpectraplot.setText(_fromUtf8("")) |
|
246 | self.specGraphCebSpectraplot.setText(_fromUtf8("")) | |
247 | self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot")) |
|
247 | self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot")) | |
248 | self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, xi+1, 3, 1, 1) |
|
248 | self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, xi+1, 3, 1, 1) | |
249 | self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
249 | self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
250 | self.specGraphCebCrossSpectraplot.setText(_fromUtf8("")) |
|
250 | self.specGraphCebCrossSpectraplot.setText(_fromUtf8("")) | |
251 | self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot")) |
|
251 | self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot")) | |
252 | self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, xi+2, 3, 1, 1) |
|
252 | self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, xi+2, 3, 1, 1) | |
253 | self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
253 | self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
254 | self.specGraphCebRTIplot.setText(_fromUtf8("")) |
|
254 | self.specGraphCebRTIplot.setText(_fromUtf8("")) | |
255 | self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot")) |
|
255 | self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot")) | |
256 | self.gridLayout_9.addWidget(self.specGraphCebRTIplot, xi+3, 3, 1, 1) |
|
256 | self.gridLayout_9.addWidget(self.specGraphCebRTIplot, xi+3, 3, 1, 1) | |
257 | self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
257 | self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra) | |
258 | self.specGraphCebCoherencmap.setText(_fromUtf8("")) |
|
258 | self.specGraphCebCoherencmap.setText(_fromUtf8("")) | |
259 | self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap")) |
|
259 | self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap")) | |
260 | self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, xi+4, 3, 1, 1) |
|
260 | self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, xi+4, 3, 1, 1) | |
261 | self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
261 | self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
262 | self.specGraphPowerprofile.setText(_fromUtf8("")) |
|
262 | self.specGraphPowerprofile.setText(_fromUtf8("")) | |
263 | self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile")) |
|
263 | self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile")) | |
264 | self.gridLayout_9.addWidget(self.specGraphPowerprofile, xi+5, 3, 1, 1) |
|
264 | self.gridLayout_9.addWidget(self.specGraphPowerprofile, xi+5, 3, 1, 1) | |
265 | self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
265 | self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
266 | self.specGraphCebRTInoise.setText(_fromUtf8("")) |
|
266 | self.specGraphCebRTInoise.setText(_fromUtf8("")) | |
267 | self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise")) |
|
267 | self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise")) | |
268 | self.gridLayout_9.addWidget(self.specGraphCebRTInoise, xi+6, 3, 1, 1) |
|
268 | self.gridLayout_9.addWidget(self.specGraphCebRTInoise, xi+6, 3, 1, 1) | |
269 |
|
269 | |||
270 | # spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
270 | # spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
271 | # self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1) |
|
271 | # self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1) | |
272 |
|
272 | |||
273 | self.label_47 = QtGui.QLabel(self.tabgraphSpectra) |
|
273 | self.label_47 = QtGui.QLabel(self.tabgraphSpectra) | |
274 | self.label_47.setObjectName(_fromUtf8("label_47")) |
|
274 | self.label_47.setObjectName(_fromUtf8("label_47")) | |
275 | self.gridLayout_9.addWidget(self.label_47, xi, 5, 1, 1) |
|
275 | self.gridLayout_9.addWidget(self.label_47, xi, 5, 1, 1) | |
276 | self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra) |
|
276 | self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra) | |
277 | self.specGraphSaveSpectra.setText(_fromUtf8("")) |
|
277 | self.specGraphSaveSpectra.setText(_fromUtf8("")) | |
278 | self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra")) |
|
278 | self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra")) | |
279 | self.gridLayout_9.addWidget(self.specGraphSaveSpectra, xi+1, 5, 1, 1) |
|
279 | self.gridLayout_9.addWidget(self.specGraphSaveSpectra, xi+1, 5, 1, 1) | |
280 | self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra) |
|
280 | self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra) | |
281 | self.specGraphSaveCross.setText(_fromUtf8("")) |
|
281 | self.specGraphSaveCross.setText(_fromUtf8("")) | |
282 | self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross")) |
|
282 | self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross")) | |
283 | self.gridLayout_9.addWidget(self.specGraphSaveCross, xi+2, 5, 1, 1) |
|
283 | self.gridLayout_9.addWidget(self.specGraphSaveCross, xi+2, 5, 1, 1) | |
284 | self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
284 | self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
285 | self.specGraphSaveRTIplot.setText(_fromUtf8("")) |
|
285 | self.specGraphSaveRTIplot.setText(_fromUtf8("")) | |
286 | self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot")) |
|
286 | self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot")) | |
287 | self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, xi+3, 5, 1, 1) |
|
287 | self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, xi+3, 5, 1, 1) | |
288 | self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
288 | self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) | |
289 | self.specGraphSaveCoherencemap.setText(_fromUtf8("")) |
|
289 | self.specGraphSaveCoherencemap.setText(_fromUtf8("")) | |
290 | self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap")) |
|
290 | self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap")) | |
291 | self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, xi+4, 5, 1, 1) |
|
291 | self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, xi+4, 5, 1, 1) | |
292 | self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
292 | self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
293 | self.specGraphSavePowerprofile.setText(_fromUtf8("")) |
|
293 | self.specGraphSavePowerprofile.setText(_fromUtf8("")) | |
294 | self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile")) |
|
294 | self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile")) | |
295 | self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, xi+5, 5, 1, 1) |
|
295 | self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, xi+5, 5, 1, 1) | |
296 | self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
296 | self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
297 | self.specGraphSaveRTInoise.setText(_fromUtf8("")) |
|
297 | self.specGraphSaveRTInoise.setText(_fromUtf8("")) | |
298 | self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise")) |
|
298 | self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise")) | |
299 | self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, xi+6, 5, 1, 1) |
|
299 | self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, xi+6, 5, 1, 1) | |
300 |
|
300 | |||
301 | self.label_19 = QtGui.QLabel(self.tabgraphSpectra) |
|
301 | self.label_19 = QtGui.QLabel(self.tabgraphSpectra) | |
302 | self.label_19.setObjectName(_fromUtf8("label_19")) |
|
302 | self.label_19.setObjectName(_fromUtf8("label_19")) | |
303 | self.gridLayout_9.addWidget(self.label_19, xi, 7, 1, 1) |
|
303 | self.gridLayout_9.addWidget(self.label_19, xi, 7, 1, 1) | |
304 | self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra) |
|
304 | self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra) | |
305 | self.specGraphftpSpectra.setText(_fromUtf8("")) |
|
305 | self.specGraphftpSpectra.setText(_fromUtf8("")) | |
306 | self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra")) |
|
306 | self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra")) | |
307 | self.gridLayout_9.addWidget(self.specGraphftpSpectra, xi+1, 7, 1, 1) |
|
307 | self.gridLayout_9.addWidget(self.specGraphftpSpectra, xi+1, 7, 1, 1) | |
308 | self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra) |
|
308 | self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra) | |
309 | self.specGraphftpCross.setText(_fromUtf8("")) |
|
309 | self.specGraphftpCross.setText(_fromUtf8("")) | |
310 | self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross")) |
|
310 | self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross")) | |
311 | self.gridLayout_9.addWidget(self.specGraphftpCross, xi+2, 7, 1, 1) |
|
311 | self.gridLayout_9.addWidget(self.specGraphftpCross, xi+2, 7, 1, 1) | |
312 | self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
312 | self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
313 | self.specGraphftpRTIplot.setText(_fromUtf8("")) |
|
313 | self.specGraphftpRTIplot.setText(_fromUtf8("")) | |
314 | self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot")) |
|
314 | self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot")) | |
315 | self.gridLayout_9.addWidget(self.specGraphftpRTIplot, xi+3, 7, 1, 1) |
|
315 | self.gridLayout_9.addWidget(self.specGraphftpRTIplot, xi+3, 7, 1, 1) | |
316 | self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
316 | self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) | |
317 | self.specGraphftpCoherencemap.setText(_fromUtf8("")) |
|
317 | self.specGraphftpCoherencemap.setText(_fromUtf8("")) | |
318 | self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap")) |
|
318 | self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap")) | |
319 | self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, xi+4, 7, 1, 1) |
|
319 | self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, xi+4, 7, 1, 1) | |
320 | self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
320 | self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
321 | self.specGraphftpPowerprofile.setText(_fromUtf8("")) |
|
321 | self.specGraphftpPowerprofile.setText(_fromUtf8("")) | |
322 | self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile")) |
|
322 | self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile")) | |
323 | self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, xi+5, 7, 1, 1) |
|
323 | self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, xi+5, 7, 1, 1) | |
324 | self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
324 | self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
325 | self.specGraphftpRTInoise.setText(_fromUtf8("")) |
|
325 | self.specGraphftpRTInoise.setText(_fromUtf8("")) | |
326 | self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise")) |
|
326 | self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise")) | |
327 | self.gridLayout_9.addWidget(self.specGraphftpRTInoise, xi+6, 7, 1, 1) |
|
327 | self.gridLayout_9.addWidget(self.specGraphftpRTInoise, xi+6, 7, 1, 1) | |
328 |
|
328 | |||
329 | # spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
329 | # spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
330 | # self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) |
|
330 | # self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) | |
331 |
|
331 | |||
332 | xi = 11 |
|
332 | xi = 11 | |
333 |
|
333 | |||
334 | self.label_22 = QtGui.QLabel(self.tabgraphSpectra) |
|
334 | self.label_22 = QtGui.QLabel(self.tabgraphSpectra) | |
335 | self.label_22.setObjectName(_fromUtf8("label_22")) |
|
335 | self.label_22.setObjectName(_fromUtf8("label_22")) | |
336 | self.gridLayout_9.addWidget(self.label_22, xi, 0, 1, 1) |
|
336 | self.gridLayout_9.addWidget(self.label_22, xi, 0, 1, 1) | |
337 | self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra) |
|
337 | self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra) | |
338 | self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq")) |
|
338 | self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq")) | |
339 | self.gridLayout_9.addWidget(self.specGgraphFreq, xi, 2, 1, 2) |
|
339 | self.gridLayout_9.addWidget(self.specGgraphFreq, xi, 2, 1, 2) | |
340 |
|
340 | |||
341 | self.label_16 = QtGui.QLabel(self.tabgraphSpectra) |
|
341 | self.label_16 = QtGui.QLabel(self.tabgraphSpectra) | |
342 | self.label_16.setObjectName(_fromUtf8("label_16")) |
|
342 | self.label_16.setObjectName(_fromUtf8("label_16")) | |
343 | self.gridLayout_9.addWidget(self.label_16, xi+1, 0, 1, 1) |
|
343 | self.gridLayout_9.addWidget(self.label_16, xi+1, 0, 1, 1) | |
344 | self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra) |
|
344 | self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra) | |
345 | self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight")) |
|
345 | self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight")) | |
346 | self.gridLayout_9.addWidget(self.specGgraphHeight, xi+1, 2, 1, 2) |
|
346 | self.gridLayout_9.addWidget(self.specGgraphHeight, xi+1, 2, 1, 2) | |
347 |
|
347 | |||
348 | self.label_17 = QtGui.QLabel(self.tabgraphSpectra) |
|
348 | self.label_17 = QtGui.QLabel(self.tabgraphSpectra) | |
349 | self.label_17.setObjectName(_fromUtf8("label_17")) |
|
349 | self.label_17.setObjectName(_fromUtf8("label_17")) | |
350 | self.gridLayout_9.addWidget(self.label_17, xi+2, 0, 1, 1) |
|
350 | self.gridLayout_9.addWidget(self.label_17, xi+2, 0, 1, 1) | |
351 | self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra) |
|
351 | self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra) | |
352 | self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange")) |
|
352 | self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange")) | |
353 | self.gridLayout_9.addWidget(self.specGgraphDbsrange, xi+2, 2, 1, 2) |
|
353 | self.gridLayout_9.addWidget(self.specGgraphDbsrange, xi+2, 2, 1, 2) | |
354 |
|
354 | |||
355 | self.specGraphTminTmaxLabel = QtGui.QLabel(self.tabgraphSpectra) |
|
355 | self.specGraphTminTmaxLabel = QtGui.QLabel(self.tabgraphSpectra) | |
356 | self.specGraphTminTmaxLabel.setObjectName(_fromUtf8("specGraphTminTmaxLabel")) |
|
356 | self.specGraphTminTmaxLabel.setObjectName(_fromUtf8("specGraphTminTmaxLabel")) | |
357 | self.gridLayout_9.addWidget(self.specGraphTminTmaxLabel, xi+3, 0, 1, 2) |
|
357 | self.gridLayout_9.addWidget(self.specGraphTminTmaxLabel, xi+3, 0, 1, 2) | |
358 | self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra) |
|
358 | self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra) | |
359 | self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax")) |
|
359 | self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax")) | |
360 | self.gridLayout_9.addWidget(self.specGgraphTminTmax, xi+3, 2, 1, 2) |
|
360 | self.gridLayout_9.addWidget(self.specGgraphTminTmax, xi+3, 2, 1, 2) | |
361 |
|
361 | |||
|
362 | self.label_48 = QtGui.QLabel(self.tabgraphSpectra) | |||
|
363 | self.label_48.setObjectName(_fromUtf8("label_48")) | |||
|
364 | self.gridLayout_9.addWidget(self.label_48, xi+4, 0, 1, 2) | |||
|
365 | self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra) | |||
|
366 | self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange")) | |||
|
367 | self.gridLayout_9.addWidget(self.specGgraphTimeRange, xi+4, 2, 1, 2) | |||
|
368 | ||||
362 | self.specGraphMagLabel = QtGui.QLabel(self.tabgraphSpectra) |
|
369 | self.specGraphMagLabel = QtGui.QLabel(self.tabgraphSpectra) | |
363 | self.specGraphMagLabel.setObjectName(_fromUtf8("specGraphMagLabel")) |
|
370 | self.specGraphMagLabel.setObjectName(_fromUtf8("specGraphMagLabel")) | |
364 | self.gridLayout_9.addWidget(self.specGraphMagLabel, xi, 4, 1, 2) |
|
371 | self.gridLayout_9.addWidget(self.specGraphMagLabel, xi, 4, 1, 2) | |
365 | self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra) |
|
372 | self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra) | |
366 | self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud")) |
|
373 | self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud")) | |
367 | self.gridLayout_9.addWidget(self.specGgraphmagnitud, xi, 6, 1, 2) |
|
374 | self.gridLayout_9.addWidget(self.specGgraphmagnitud, xi, 6, 1, 2) | |
368 |
|
375 | |||
369 | self.specGraphPhaseLabel = QtGui.QLabel(self.tabgraphSpectra) |
|
376 | self.specGraphPhaseLabel = QtGui.QLabel(self.tabgraphSpectra) | |
370 | self.specGraphPhaseLabel.setObjectName(_fromUtf8("specGraphPhaseLabel")) |
|
377 | self.specGraphPhaseLabel.setObjectName(_fromUtf8("specGraphPhaseLabel")) | |
371 | self.gridLayout_9.addWidget(self.specGraphPhaseLabel, xi+1, 4, 1, 2) |
|
378 | self.gridLayout_9.addWidget(self.specGraphPhaseLabel, xi+1, 4, 1, 2) | |
372 | self.specGgraphPhase = QtGui.QLineEdit(self.tabgraphSpectra) |
|
379 | self.specGgraphPhase = QtGui.QLineEdit(self.tabgraphSpectra) | |
373 | self.specGgraphPhase.setObjectName(_fromUtf8("specGgraphPhase")) |
|
380 | self.specGgraphPhase.setObjectName(_fromUtf8("specGgraphPhase")) | |
374 | self.gridLayout_9.addWidget(self.specGgraphPhase, xi+1, 6, 1, 2) |
|
381 | self.gridLayout_9.addWidget(self.specGgraphPhase, xi+1, 6, 1, 2) | |
375 |
|
382 | |||
376 | self.label_6 = QtGui.QLabel(self.tabgraphSpectra) |
|
383 | self.label_6 = QtGui.QLabel(self.tabgraphSpectra) | |
377 | self.label_6.setObjectName(_fromUtf8("label_6")) |
|
384 | self.label_6.setObjectName(_fromUtf8("label_6")) | |
378 | self.gridLayout_9.addWidget(self.label_6, xi+2, 4, 1, 1) |
|
385 | self.gridLayout_9.addWidget(self.label_6, xi+2, 4, 1, 1) | |
379 | self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra) |
|
386 | self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra) | |
380 | self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList")) |
|
387 | self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList")) | |
381 | self.gridLayout_9.addWidget(self.specGgraphChannelList, xi+2, 6, 1, 2) |
|
388 | self.gridLayout_9.addWidget(self.specGgraphChannelList, xi+2, 6, 1, 2) | |
382 |
|
389 | |||
383 | self.label_29 = QtGui.QLabel(self.tabgraphSpectra) |
|
390 | self.label_29 = QtGui.QLabel(self.tabgraphSpectra) | |
384 | self.label_29.setObjectName(_fromUtf8("label_29")) |
|
391 | self.label_29.setObjectName(_fromUtf8("label_29")) | |
385 | self.gridLayout_9.addWidget(self.label_29, xi+3, 4, 1, 2) |
|
392 | self.gridLayout_9.addWidget(self.label_29, xi+3, 4, 1, 2) | |
386 | self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra) |
|
393 | self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra) | |
387 | self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio")) |
|
394 | self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio")) | |
388 | self.gridLayout_9.addWidget(self.specGgraphftpratio, xi+3, 6, 1, 2) |
|
395 | self.gridLayout_9.addWidget(self.specGgraphftpratio, xi+3, 6, 1, 2) | |
389 |
|
||||
390 | self.label_48 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
391 | self.label_48.setObjectName(_fromUtf8("label_48")) |
|
|||
392 | self.gridLayout_9.addWidget(self.label_48, xi+4, 4, 1, 2) |
|
|||
393 | self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
394 | self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange")) |
|
|||
395 | self.gridLayout_9.addWidget(self.specGgraphTimeRange, xi+4, 6, 1, 2) |
|
|||
396 |
|
396 | |||
397 | # spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
397 | # spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
398 | # self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) |
|
398 | # self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) | |
399 | # spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
399 | # spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
400 | # self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) |
|
400 | # self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) | |
401 | # spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
401 | # spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
402 | # self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) |
|
402 | # self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) | |
403 |
|
403 | |||
404 |
|
404 | |||
405 |
|
405 | |||
406 | self.tabWidgetSpectra.addTab(self.tabgraphSpectra, _fromUtf8("")) |
|
406 | self.tabWidgetSpectra.addTab(self.tabgraphSpectra, _fromUtf8("")) | |
407 | self.taboutputSpectra = QtGui.QWidget() |
|
407 | self.taboutputSpectra = QtGui.QWidget() | |
408 | self.taboutputSpectra.setObjectName(_fromUtf8("taboutputSpectra")) |
|
408 | self.taboutputSpectra.setObjectName(_fromUtf8("taboutputSpectra")) | |
409 | self.gridLayout_11 = QtGui.QGridLayout(self.taboutputSpectra) |
|
409 | self.gridLayout_11 = QtGui.QGridLayout(self.taboutputSpectra) | |
410 | self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) |
|
410 | self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) | |
411 | self.label_39 = QtGui.QLabel(self.taboutputSpectra) |
|
411 | self.label_39 = QtGui.QLabel(self.taboutputSpectra) | |
412 | self.label_39.setObjectName(_fromUtf8("label_39")) |
|
412 | self.label_39.setObjectName(_fromUtf8("label_39")) | |
413 | self.gridLayout_11.addWidget(self.label_39, 0, 0, 1, 1) |
|
413 | self.gridLayout_11.addWidget(self.label_39, 0, 0, 1, 1) | |
414 | self.specOutputComData = QtGui.QComboBox(self.taboutputSpectra) |
|
414 | self.specOutputComData = QtGui.QComboBox(self.taboutputSpectra) | |
415 | self.specOutputComData.setObjectName(_fromUtf8("specOutputComData")) |
|
415 | self.specOutputComData.setObjectName(_fromUtf8("specOutputComData")) | |
416 | self.specOutputComData.addItem(_fromUtf8("")) |
|
416 | self.specOutputComData.addItem(_fromUtf8("")) | |
417 | self.gridLayout_11.addWidget(self.specOutputComData, 0, 2, 1, 2) |
|
417 | self.gridLayout_11.addWidget(self.specOutputComData, 0, 2, 1, 2) | |
418 | self.label_34 = QtGui.QLabel(self.taboutputSpectra) |
|
418 | self.label_34 = QtGui.QLabel(self.taboutputSpectra) | |
419 | self.label_34.setObjectName(_fromUtf8("label_34")) |
|
419 | self.label_34.setObjectName(_fromUtf8("label_34")) | |
420 | self.gridLayout_11.addWidget(self.label_34, 1, 0, 1, 1) |
|
420 | self.gridLayout_11.addWidget(self.label_34, 1, 0, 1, 1) | |
421 | self.specOutputPath = QtGui.QLineEdit(self.taboutputSpectra) |
|
421 | self.specOutputPath = QtGui.QLineEdit(self.taboutputSpectra) | |
422 | self.specOutputPath.setObjectName(_fromUtf8("specOutputPath")) |
|
422 | self.specOutputPath.setObjectName(_fromUtf8("specOutputPath")) | |
423 | self.gridLayout_11.addWidget(self.specOutputPath, 1, 2, 1, 1) |
|
423 | self.gridLayout_11.addWidget(self.specOutputPath, 1, 2, 1, 1) | |
424 | spacerItem20 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
424 | spacerItem20 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
425 | self.gridLayout_11.addItem(spacerItem20, 4, 2, 1, 1) |
|
425 | self.gridLayout_11.addItem(spacerItem20, 4, 2, 1, 1) | |
426 | self.specOutputToolPath = QtGui.QToolButton(self.taboutputSpectra) |
|
426 | self.specOutputToolPath = QtGui.QToolButton(self.taboutputSpectra) | |
427 | self.specOutputToolPath.setObjectName(_fromUtf8("specOutputToolPath")) |
|
427 | self.specOutputToolPath.setObjectName(_fromUtf8("specOutputToolPath")) | |
428 | self.gridLayout_11.addWidget(self.specOutputToolPath, 1, 3, 1, 1) |
|
428 | self.gridLayout_11.addWidget(self.specOutputToolPath, 1, 3, 1, 1) | |
429 | self.specOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectra) |
|
429 | self.specOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectra) | |
430 | self.specOutputblocksperfile.setObjectName(_fromUtf8("specOutputblocksperfile")) |
|
430 | self.specOutputblocksperfile.setObjectName(_fromUtf8("specOutputblocksperfile")) | |
431 | self.gridLayout_11.addWidget(self.specOutputblocksperfile, 2, 2, 1, 1) |
|
431 | self.gridLayout_11.addWidget(self.specOutputblocksperfile, 2, 2, 1, 1) | |
432 | self.label_9 = QtGui.QLabel(self.taboutputSpectra) |
|
432 | self.label_9 = QtGui.QLabel(self.taboutputSpectra) | |
433 | self.label_9.setObjectName(_fromUtf8("label_9")) |
|
433 | self.label_9.setObjectName(_fromUtf8("label_9")) | |
434 | self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2) |
|
434 | self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2) | |
435 |
|
435 | |||
436 | self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8("")) |
|
436 | self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8("")) | |
437 | self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1) |
|
437 | self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1) | |
438 |
|
438 | |||
439 | self.tabWidgetProject.addTab(self.tabSpectra, _fromUtf8("")) |
|
439 | self.tabWidgetProject.addTab(self.tabSpectra, _fromUtf8("")) | |
440 |
|
440 | |||
441 | self.tabWidgetSpectra.setCurrentIndex(0) |
|
441 | self.tabWidgetSpectra.setCurrentIndex(0) | |
442 |
|
442 | |||
443 | def retranslateUi(self): |
|
443 | def retranslateUi(self): | |
444 |
|
444 | |||
445 | self.specOpOk.setText(_translate("MainWindow", "Ok", None)) |
|
445 | self.specOpOk.setText(_translate("MainWindow", "Ok", None)) | |
446 | self.specGraphClear.setText(_translate("MainWindow", "Clear", None)) |
|
446 | self.specGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
447 | self.specOpCebCrossSpectra.setText(_translate("MainWindow", "Select Cross Spectra:", None)) |
|
447 | self.specOpCebCrossSpectra.setText(_translate("MainWindow", "Select Cross Spectra:", None)) | |
448 | self.specOpComChannel.setItemText(0, _translate("MainWindow", "Value", None)) |
|
448 | self.specOpComChannel.setItemText(0, _translate("MainWindow", "Value", None)) | |
449 | self.specOpComChannel.setItemText(1, _translate("MainWindow", "Index", None)) |
|
449 | self.specOpComChannel.setItemText(1, _translate("MainWindow", "Index", None)) | |
450 | self.specOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) |
|
450 | self.specOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) | |
451 | self.specOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) |
|
451 | self.specOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) | |
452 | self.specOpCebRemoveDC.setText(_translate("MainWindow", "Remove DC:", None)) |
|
452 | self.specOpCebRemoveDC.setText(_translate("MainWindow", "Remove DC:", None)) | |
453 | self.specOpCebHeights.setText(_translate("MainWindow", "Select Heights:", None)) |
|
453 | self.specOpCebHeights.setText(_translate("MainWindow", "Select Heights:", None)) | |
454 | self.specOpCebChannel.setText(_translate("MainWindow", "Select Channel:", None)) |
|
454 | self.specOpCebChannel.setText(_translate("MainWindow", "Select Channel:", None)) | |
455 |
|
455 | |||
456 | self.specOpComCrossSpectra.setItemText(0, _translate("MainWindow", "x-y pairs", None)) |
|
456 | self.specOpComCrossSpectra.setItemText(0, _translate("MainWindow", "x-y pairs", None)) | |
457 |
|
457 | |||
458 | self.specLabnFFTPoints.setText(_translate("MainWindow", "Number of FFT points:", None)) |
|
458 | self.specLabnFFTPoints.setText(_translate("MainWindow", "Number of FFT points:", None)) | |
459 | self.specOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Integration:", None)) |
|
459 | self.specOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Integration:", None)) | |
460 | self.specOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) |
|
460 | self.specOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) | |
461 | self.specOpCobIncInt.setItemText(1, _translate("MainWindow", "Number of Profiles", None)) |
|
461 | self.specOpCobIncInt.setItemText(1, _translate("MainWindow", "Number of Profiles", None)) | |
462 | self.specOpCebRadarfrequency.setText(_translate("MainWindow", "Radar frequency (MHz):", None)) |
|
462 | self.specOpCebRadarfrequency.setText(_translate("MainWindow", "Radar frequency (MHz):", None)) | |
463 | self.specLabProfiles.setText(_translate("MainWindow", "Number of Profiles", None)) |
|
463 | self.specLabProfiles.setText(_translate("MainWindow", "Number of Profiles", None)) | |
464 | self.specOpCebRemoveInt.setText(_translate("MainWindow", "Remove Interference:", None)) |
|
464 | self.specOpCebRemoveInt.setText(_translate("MainWindow", "Remove Interference:", None)) | |
465 | self.specLabippFactor.setText(_translate("MainWindow", "Ipp Factor:", None)) |
|
465 | self.specLabippFactor.setText(_translate("MainWindow", "Ipp Factor:", None)) | |
466 | self.specOpCebgetNoise.setText(_translate("MainWindow", "Set Noise area:", None)) |
|
466 | self.specOpCebgetNoise.setText(_translate("MainWindow", "Set Noise area:", None)) | |
467 | self.specOpComRemoveDC.setItemText(0, _translate("MainWindow", "Mode 1", None)) |
|
467 | self.specOpComRemoveDC.setItemText(0, _translate("MainWindow", "Mode 1", None)) | |
468 | self.specOpComRemoveDC.setItemText(1, _translate("MainWindow", "Mode 2", None)) |
|
468 | self.specOpComRemoveDC.setItemText(1, _translate("MainWindow", "Mode 2", None)) | |
469 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabopSpectra), _translate("MainWindow", "Operation", None)) |
|
469 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabopSpectra), _translate("MainWindow", "Operation", None)) | |
470 |
|
470 | |||
471 | self.label_44.setText(_translate("MainWindow", "Coherence Map:", None)) |
|
471 | self.label_44.setText(_translate("MainWindow", "Coherence Map:", None)) | |
472 | self.specGraphTminTmaxLabel.setText(_translate("MainWindow", "Time range:", None)) |
|
472 | self.specGraphTminTmaxLabel.setText(_translate("MainWindow", "Time range (hours):", None)) | |
473 | self.label_25.setText(_translate("MainWindow", "Prefix:", None)) |
|
473 | self.label_25.setText(_translate("MainWindow", "Prefix:", None)) | |
474 | self.label_42.setText(_translate("MainWindow", "RTI Plot:", None)) |
|
474 | self.label_42.setText(_translate("MainWindow", "RTI Plot:", None)) | |
475 | self.label_16.setText(_translate("MainWindow", "Height range:", None)) |
|
475 | self.label_16.setText(_translate("MainWindow", "Height range:", None)) | |
476 | self.label_17.setText(_translate("MainWindow", "dB range:", None)) |
|
476 | self.label_17.setText(_translate("MainWindow", "dB range:", None)) | |
477 | self.specGraphMagLabel.setText(_translate("MainWindow", "Coh. Magnitud:", None)) |
|
477 | self.specGraphMagLabel.setText(_translate("MainWindow", "Coh. Magnitud:", None)) | |
478 | self.label_24.setText(_translate("MainWindow", "Path:", None)) |
|
478 | self.label_24.setText(_translate("MainWindow", "Path:", None)) | |
479 | self.label_46.setText(_translate("MainWindow", "Power Profile:", None)) |
|
479 | self.label_46.setText(_translate("MainWindow", "Power Profile:", None)) | |
480 | self.label_22.setText(_translate("MainWindow", "Freq/Vel range:", None)) |
|
480 | self.label_22.setText(_translate("MainWindow", "Freq/Vel range:", None)) | |
481 | self.label_41.setText(_translate("MainWindow", "Cross Spectra Plot:", None)) |
|
481 | self.label_41.setText(_translate("MainWindow", "Cross Spectra Plot:", None)) | |
482 | self.specGraphToolPath.setText(_translate("MainWindow", "...", None)) |
|
482 | self.specGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
483 | self.label_6.setText(_translate("MainWindow", "Channel List:", None)) |
|
483 | self.label_6.setText(_translate("MainWindow", "Channel List:", None)) | |
484 | self.label_40.setText(_translate("MainWindow", "Spectra Plot:", None)) |
|
484 | self.label_40.setText(_translate("MainWindow", "Spectra Plot:", None)) | |
485 | self.label_43.setText(_translate("MainWindow", "Show:", None)) |
|
485 | self.label_43.setText(_translate("MainWindow", "Show:", None)) | |
486 | self.label_29.setText(_translate("MainWindow", "Writing Period:", None)) |
|
486 | self.label_29.setText(_translate("MainWindow", "Writing Period:", None)) | |
487 | self.label_47.setText(_translate("MainWindow", "Save:", None)) |
|
487 | self.label_47.setText(_translate("MainWindow", "Save:", None)) | |
488 | self.label_19.setText(_translate("MainWindow", "Ftp:", None)) |
|
488 | self.label_19.setText(_translate("MainWindow", "Ftp:", None)) | |
489 | self.label_45.setText(_translate("MainWindow", "Noise:", None)) |
|
489 | self.label_45.setText(_translate("MainWindow", "Noise:", None)) | |
490 |
self.label_48.setText(_translate("MainWindow", "Time |
|
490 | self.label_48.setText(_translate("MainWindow", "Time window (seconds):", None)) | |
491 | self.specGraphPhaseLabel.setText(_translate("MainWindow", "Coh. Phase:", None)) |
|
491 | self.specGraphPhaseLabel.setText(_translate("MainWindow", "Coh. Phase:", None)) | |
492 | self.label_48.hide() |
|
492 | # self.label_48.hide() | |
493 | self.specGgraphTimeRange.hide() |
|
493 | # self.specGgraphTimeRange.hide() | |
494 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabgraphSpectra), _translate("MainWindow", "Graphics", None)) |
|
494 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabgraphSpectra), _translate("MainWindow", "Graphics", None)) | |
495 |
|
495 | |||
496 | self.label_39.setText(_translate("MainWindow", "Type:", None)) |
|
496 | self.label_39.setText(_translate("MainWindow", "Type:", None)) | |
497 | self.specOutputComData.setItemText(0, _translate("MainWindow", ".pdata", None)) |
|
497 | self.specOutputComData.setItemText(0, _translate("MainWindow", ".pdata", None)) | |
498 | self.label_34.setText(_translate("MainWindow", "Path:", None)) |
|
498 | self.label_34.setText(_translate("MainWindow", "Path:", None)) | |
499 | self.specOutputToolPath.setText(_translate("MainWindow", "...", None)) |
|
499 | self.specOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
500 | self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None)) |
|
500 | self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None)) | |
501 |
|
501 | |||
502 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None)) |
|
502 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None)) | |
503 |
|
503 | |||
504 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None)) |
|
504 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None)) | |
505 |
|
505 | |||
506 | self.__setToolTip() |
|
506 | self.__setToolTip() | |
507 |
|
507 | |||
508 | def __setToolTip(self): |
|
508 | def __setToolTip(self): | |
509 |
|
509 | |||
510 | self.specOpnFFTpoints.setToolTip('Number of FFT points used in FFT function. Example: 128') |
|
510 | self.specOpnFFTpoints.setToolTip('Number of FFT points used in FFT function. Example: 128') | |
511 | self.specOpProfiles.setToolTip('Number of data points used in FFT function. Example: 128') |
|
511 | self.specOpProfiles.setToolTip('Number of data points used in FFT function. Example: 128') | |
512 | self.specOpippFactor.setToolTip('This factor is multiplied to IPP value to get velocity and frequency range. Example: 4') |
|
512 | self.specOpippFactor.setToolTip('This factor is multiplied to IPP value to get velocity and frequency range. Example: 4') | |
513 | self.specOpIncoherent.setToolTip('Example: 10') |
|
513 | self.specOpIncoherent.setToolTip('Example: 10') | |
514 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
514 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
515 |
|
515 | |||
516 | self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
516 | self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
517 | self.specOpHeights.setToolTip('Example: 90,180') |
|
517 | self.specOpHeights.setToolTip('Example: 90,180') | |
518 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
518 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
519 | # tool tip gui specGraph |
|
519 | # tool tip gui specGraph | |
520 |
|
520 | |||
521 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
521 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
522 | self.specGgraphFreq.setToolTip('Example: -20,20') |
|
522 | self.specGgraphFreq.setToolTip('Example: -20,20') | |
523 | self.specGgraphHeight.setToolTip('Example: 100,400') |
|
523 | self.specGgraphHeight.setToolTip('Example: 100,400') | |
524 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
524 | self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
525 |
|
525 | |||
526 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
526 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
527 |
|
527 | |||
528 | No newline at end of file |
|
528 |
@@ -1,1509 +1,1509 | |||||
1 | ''' |
|
1 | ''' | |
2 | Created on Jul 9, 2014 |
|
2 | Created on Jul 9, 2014 | |
3 |
|
3 | |||
4 | @author: roj-idl71 |
|
4 | @author: roj-idl71 | |
5 | ''' |
|
5 | ''' | |
6 | import os |
|
6 | import os | |
7 | import datetime |
|
7 | import datetime | |
8 | import numpy |
|
8 | import numpy | |
9 |
|
9 | |||
10 | from figure import Figure, isRealtime, isTimeInHourRange |
|
10 | from figure import Figure, isRealtime, isTimeInHourRange | |
11 | from plotting_codes import * |
|
11 | from plotting_codes import * | |
12 |
|
12 | |||
13 | class SpectraPlot(Figure): |
|
13 | class SpectraPlot(Figure): | |
14 |
|
14 | |||
15 | isConfig = None |
|
15 | isConfig = None | |
16 | __nsubplots = None |
|
16 | __nsubplots = None | |
17 |
|
17 | |||
18 | WIDTHPROF = None |
|
18 | WIDTHPROF = None | |
19 | HEIGHTPROF = None |
|
19 | HEIGHTPROF = None | |
20 | PREFIX = 'spc' |
|
20 | PREFIX = 'spc' | |
21 |
|
21 | |||
22 | def __init__(self): |
|
22 | def __init__(self): | |
23 |
|
23 | |||
24 | self.isConfig = False |
|
24 | self.isConfig = False | |
25 | self.__nsubplots = 1 |
|
25 | self.__nsubplots = 1 | |
26 |
|
26 | |||
27 | self.WIDTH = 250 |
|
27 | self.WIDTH = 250 | |
28 | self.HEIGHT = 250 |
|
28 | self.HEIGHT = 250 | |
29 | self.WIDTHPROF = 120 |
|
29 | self.WIDTHPROF = 120 | |
30 | self.HEIGHTPROF = 0 |
|
30 | self.HEIGHTPROF = 0 | |
31 | self.counter_imagwr = 0 |
|
31 | self.counter_imagwr = 0 | |
32 |
|
32 | |||
33 | self.PLOT_CODE = SPEC_CODE |
|
33 | self.PLOT_CODE = SPEC_CODE | |
34 |
|
34 | |||
35 | self.FTP_WEI = None |
|
35 | self.FTP_WEI = None | |
36 | self.EXP_CODE = None |
|
36 | self.EXP_CODE = None | |
37 | self.SUB_EXP_CODE = None |
|
37 | self.SUB_EXP_CODE = None | |
38 | self.PLOT_POS = None |
|
38 | self.PLOT_POS = None | |
39 |
|
39 | |||
40 | self.__xfilter_ena = False |
|
40 | self.__xfilter_ena = False | |
41 | self.__yfilter_ena = False |
|
41 | self.__yfilter_ena = False | |
42 |
|
42 | |||
43 | def getSubplots(self): |
|
43 | def getSubplots(self): | |
44 |
|
44 | |||
45 | ncol = int(numpy.sqrt(self.nplots)+0.9) |
|
45 | ncol = int(numpy.sqrt(self.nplots)+0.9) | |
46 | nrow = int(self.nplots*1./ncol + 0.9) |
|
46 | nrow = int(self.nplots*1./ncol + 0.9) | |
47 |
|
47 | |||
48 | return nrow, ncol |
|
48 | return nrow, ncol | |
49 |
|
49 | |||
50 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
50 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
51 |
|
51 | |||
52 | self.__showprofile = showprofile |
|
52 | self.__showprofile = showprofile | |
53 | self.nplots = nplots |
|
53 | self.nplots = nplots | |
54 |
|
54 | |||
55 | ncolspan = 1 |
|
55 | ncolspan = 1 | |
56 | colspan = 1 |
|
56 | colspan = 1 | |
57 | if showprofile: |
|
57 | if showprofile: | |
58 | ncolspan = 3 |
|
58 | ncolspan = 3 | |
59 | colspan = 2 |
|
59 | colspan = 2 | |
60 | self.__nsubplots = 2 |
|
60 | self.__nsubplots = 2 | |
61 |
|
61 | |||
62 | self.createFigure(id = id, |
|
62 | self.createFigure(id = id, | |
63 | wintitle = wintitle, |
|
63 | wintitle = wintitle, | |
64 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
64 | widthplot = self.WIDTH + self.WIDTHPROF, | |
65 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
65 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
66 | show=show) |
|
66 | show=show) | |
67 |
|
67 | |||
68 | nrow, ncol = self.getSubplots() |
|
68 | nrow, ncol = self.getSubplots() | |
69 |
|
69 | |||
70 | counter = 0 |
|
70 | counter = 0 | |
71 | for y in range(nrow): |
|
71 | for y in range(nrow): | |
72 | for x in range(ncol): |
|
72 | for x in range(ncol): | |
73 |
|
73 | |||
74 | if counter >= self.nplots: |
|
74 | if counter >= self.nplots: | |
75 | break |
|
75 | break | |
76 |
|
76 | |||
77 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
77 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
78 |
|
78 | |||
79 | if showprofile: |
|
79 | if showprofile: | |
80 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) |
|
80 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) | |
81 |
|
81 | |||
82 | counter += 1 |
|
82 | counter += 1 | |
83 |
|
83 | |||
84 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True, |
|
84 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True, | |
85 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, |
|
85 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
86 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, |
|
86 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, | |
87 | server=None, folder=None, username=None, password=None, |
|
87 | server=None, folder=None, username=None, password=None, | |
88 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False, |
|
88 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False, | |
89 | xaxis="velocity"): |
|
89 | xaxis="velocity"): | |
90 |
|
90 | |||
91 | """ |
|
91 | """ | |
92 |
|
92 | |||
93 | Input: |
|
93 | Input: | |
94 | dataOut : |
|
94 | dataOut : | |
95 | id : |
|
95 | id : | |
96 | wintitle : |
|
96 | wintitle : | |
97 | channelList : |
|
97 | channelList : | |
98 | showProfile : |
|
98 | showProfile : | |
99 | xmin : None, |
|
99 | xmin : None, | |
100 | xmax : None, |
|
100 | xmax : None, | |
101 | ymin : None, |
|
101 | ymin : None, | |
102 | ymax : None, |
|
102 | ymax : None, | |
103 | zmin : None, |
|
103 | zmin : None, | |
104 | zmax : None |
|
104 | zmax : None | |
105 | """ |
|
105 | """ | |
106 |
|
106 | |||
107 | if realtime: |
|
107 | if realtime: | |
108 | if not(isRealtime(utcdatatime = dataOut.utctime)): |
|
108 | if not(isRealtime(utcdatatime = dataOut.utctime)): | |
109 | print 'Skipping this plot function' |
|
109 | print 'Skipping this plot function' | |
110 | return |
|
110 | return | |
111 |
|
111 | |||
112 | if channelList == None: |
|
112 | if channelList == None: | |
113 | channelIndexList = dataOut.channelIndexList |
|
113 | channelIndexList = dataOut.channelIndexList | |
114 | else: |
|
114 | else: | |
115 | channelIndexList = [] |
|
115 | channelIndexList = [] | |
116 | for channel in channelList: |
|
116 | for channel in channelList: | |
117 | if channel not in dataOut.channelList: |
|
117 | if channel not in dataOut.channelList: | |
118 | raise ValueError, "Channel %d is not in dataOut.channelList" %channel |
|
118 | raise ValueError, "Channel %d is not in dataOut.channelList" %channel | |
119 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
119 | channelIndexList.append(dataOut.channelList.index(channel)) | |
120 |
|
120 | |||
121 | factor = dataOut.normFactor |
|
121 | factor = dataOut.normFactor | |
122 |
|
122 | |||
123 | if xaxis == "frequency": |
|
123 | if xaxis == "frequency": | |
124 | x = dataOut.getFreqRange(1)/1000. |
|
124 | x = dataOut.getFreqRange(1)/1000. | |
125 | xlabel = "Frquency (kHz)" |
|
125 | xlabel = "Frquency (kHz)" | |
126 |
|
126 | |||
127 | elif xaxis == "time": |
|
127 | elif xaxis == "time": | |
128 | x = dataOut.getAcfRange(1) |
|
128 | x = dataOut.getAcfRange(1) | |
129 | xlabel = "Time (ms)" |
|
129 | xlabel = "Time (ms)" | |
130 |
|
130 | |||
131 | else: |
|
131 | else: | |
132 | x = dataOut.getVelRange(1) |
|
132 | x = dataOut.getVelRange(1) | |
133 | xlabel = "Velocity (m/s)" |
|
133 | xlabel = "Velocity (m/s)" | |
134 |
|
134 | |||
135 | ylabel = "Range (Km)" |
|
135 | ylabel = "Range (Km)" | |
136 |
|
136 | |||
137 | y = dataOut.getHeiRange() |
|
137 | y = dataOut.getHeiRange() | |
138 |
|
138 | |||
139 | z = dataOut.data_spc/factor |
|
139 | z = dataOut.data_spc/factor | |
140 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
140 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) | |
141 | zdB = 10*numpy.log10(z) |
|
141 | zdB = 10*numpy.log10(z) | |
142 |
|
142 | |||
143 | avg = numpy.average(z, axis=1) |
|
143 | avg = numpy.average(z, axis=1) | |
144 | avgdB = 10*numpy.log10(avg) |
|
144 | avgdB = 10*numpy.log10(avg) | |
145 |
|
145 | |||
146 | noise = dataOut.getNoise()/factor |
|
146 | noise = dataOut.getNoise()/factor | |
147 | noisedB = 10*numpy.log10(noise) |
|
147 | noisedB = 10*numpy.log10(noise) | |
148 |
|
148 | |||
149 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
149 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
150 | title = wintitle + " Spectra" |
|
150 | title = wintitle + " Spectra" | |
151 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): |
|
151 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
152 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) |
|
152 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) | |
153 |
|
153 | |||
154 | if not self.isConfig: |
|
154 | if not self.isConfig: | |
155 |
|
155 | |||
156 | nplots = len(channelIndexList) |
|
156 | nplots = len(channelIndexList) | |
157 |
|
157 | |||
158 | self.setup(id=id, |
|
158 | self.setup(id=id, | |
159 | nplots=nplots, |
|
159 | nplots=nplots, | |
160 | wintitle=wintitle, |
|
160 | wintitle=wintitle, | |
161 | showprofile=showprofile, |
|
161 | showprofile=showprofile, | |
162 | show=show) |
|
162 | show=show) | |
163 |
|
163 | |||
164 | if xmin == None: xmin = numpy.nanmin(x) |
|
164 | if xmin == None: xmin = numpy.nanmin(x) | |
165 | if xmax == None: xmax = numpy.nanmax(x) |
|
165 | if xmax == None: xmax = numpy.nanmax(x) | |
166 | if ymin == None: ymin = numpy.nanmin(y) |
|
166 | if ymin == None: ymin = numpy.nanmin(y) | |
167 | if ymax == None: ymax = numpy.nanmax(y) |
|
167 | if ymax == None: ymax = numpy.nanmax(y) | |
168 | if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3 |
|
168 | if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3 | |
169 | if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3 |
|
169 | if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3 | |
170 |
|
170 | |||
171 | self.FTP_WEI = ftp_wei |
|
171 | self.FTP_WEI = ftp_wei | |
172 | self.EXP_CODE = exp_code |
|
172 | self.EXP_CODE = exp_code | |
173 | self.SUB_EXP_CODE = sub_exp_code |
|
173 | self.SUB_EXP_CODE = sub_exp_code | |
174 | self.PLOT_POS = plot_pos |
|
174 | self.PLOT_POS = plot_pos | |
175 |
|
175 | |||
176 | self.isConfig = True |
|
176 | self.isConfig = True | |
177 |
|
177 | |||
178 | self.setWinTitle(title) |
|
178 | self.setWinTitle(title) | |
179 |
|
179 | |||
180 | for i in range(self.nplots): |
|
180 | for i in range(self.nplots): | |
181 | index = channelIndexList[i] |
|
181 | index = channelIndexList[i] | |
182 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
182 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) | |
183 | title = "Channel %d: %4.2fdB: %s" %(dataOut.channelList[index], noisedB[index], str_datetime) |
|
183 | title = "Channel %d: %4.2fdB: %s" %(dataOut.channelList[index], noisedB[index], str_datetime) | |
184 | if len(dataOut.beam.codeList) != 0: |
|
184 | if len(dataOut.beam.codeList) != 0: | |
185 | title = "Ch%d:%4.2fdB,%2.2f,%2.2f:%s" %(dataOut.channelList[index], noisedB[index], dataOut.beam.azimuthList[index], dataOut.beam.zenithList[index], str_datetime) |
|
185 | title = "Ch%d:%4.2fdB,%2.2f,%2.2f:%s" %(dataOut.channelList[index], noisedB[index], dataOut.beam.azimuthList[index], dataOut.beam.zenithList[index], str_datetime) | |
186 |
|
186 | |||
187 | axes = self.axesList[i*self.__nsubplots] |
|
187 | axes = self.axesList[i*self.__nsubplots] | |
188 | axes.pcolor(x, y, zdB[index,:,:], |
|
188 | axes.pcolor(x, y, zdB[index,:,:], | |
189 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
189 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
190 | xlabel=xlabel, ylabel=ylabel, title=title, |
|
190 | xlabel=xlabel, ylabel=ylabel, title=title, | |
191 | ticksize=9, cblabel='') |
|
191 | ticksize=9, cblabel='') | |
192 |
|
192 | |||
193 | if self.__showprofile: |
|
193 | if self.__showprofile: | |
194 | axes = self.axesList[i*self.__nsubplots +1] |
|
194 | axes = self.axesList[i*self.__nsubplots +1] | |
195 | axes.pline(avgdB[index,:], y, |
|
195 | axes.pline(avgdB[index,:], y, | |
196 | xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax, |
|
196 | xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax, | |
197 | xlabel='dB', ylabel='', title='', |
|
197 | xlabel='dB', ylabel='', title='', | |
198 | ytick_visible=False, |
|
198 | ytick_visible=False, | |
199 | grid='x') |
|
199 | grid='x') | |
200 |
|
200 | |||
201 | noiseline = numpy.repeat(noisedB[index], len(y)) |
|
201 | noiseline = numpy.repeat(noisedB[index], len(y)) | |
202 | axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2) |
|
202 | axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2) | |
203 |
|
203 | |||
204 | self.draw() |
|
204 | self.draw() | |
205 |
|
205 | |||
206 | if figfile == None: |
|
206 | if figfile == None: | |
207 | str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
207 | str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
208 | name = str_datetime |
|
208 | name = str_datetime | |
209 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): |
|
209 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
210 | name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith) |
|
210 | name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith) | |
211 | figfile = self.getFilename(name) |
|
211 | figfile = self.getFilename(name) | |
212 |
|
212 | |||
213 | self.save(figpath=figpath, |
|
213 | self.save(figpath=figpath, | |
214 | figfile=figfile, |
|
214 | figfile=figfile, | |
215 | save=save, |
|
215 | save=save, | |
216 | ftp=ftp, |
|
216 | ftp=ftp, | |
217 | wr_period=wr_period, |
|
217 | wr_period=wr_period, | |
218 | thisDatetime=thisDatetime) |
|
218 | thisDatetime=thisDatetime) | |
219 |
|
219 | |||
220 | class CrossSpectraPlot(Figure): |
|
220 | class CrossSpectraPlot(Figure): | |
221 |
|
221 | |||
222 | isConfig = None |
|
222 | isConfig = None | |
223 | __nsubplots = None |
|
223 | __nsubplots = None | |
224 |
|
224 | |||
225 | WIDTH = None |
|
225 | WIDTH = None | |
226 | HEIGHT = None |
|
226 | HEIGHT = None | |
227 | WIDTHPROF = None |
|
227 | WIDTHPROF = None | |
228 | HEIGHTPROF = None |
|
228 | HEIGHTPROF = None | |
229 | PREFIX = 'cspc' |
|
229 | PREFIX = 'cspc' | |
230 |
|
230 | |||
231 | def __init__(self): |
|
231 | def __init__(self): | |
232 |
|
232 | |||
233 | self.isConfig = False |
|
233 | self.isConfig = False | |
234 | self.__nsubplots = 4 |
|
234 | self.__nsubplots = 4 | |
235 | self.counter_imagwr = 0 |
|
235 | self.counter_imagwr = 0 | |
236 | self.WIDTH = 250 |
|
236 | self.WIDTH = 250 | |
237 | self.HEIGHT = 250 |
|
237 | self.HEIGHT = 250 | |
238 | self.WIDTHPROF = 0 |
|
238 | self.WIDTHPROF = 0 | |
239 | self.HEIGHTPROF = 0 |
|
239 | self.HEIGHTPROF = 0 | |
240 |
|
240 | |||
241 | self.PLOT_CODE = CROSS_CODE |
|
241 | self.PLOT_CODE = CROSS_CODE | |
242 | self.FTP_WEI = None |
|
242 | self.FTP_WEI = None | |
243 | self.EXP_CODE = None |
|
243 | self.EXP_CODE = None | |
244 | self.SUB_EXP_CODE = None |
|
244 | self.SUB_EXP_CODE = None | |
245 | self.PLOT_POS = None |
|
245 | self.PLOT_POS = None | |
246 |
|
246 | |||
247 | def getSubplots(self): |
|
247 | def getSubplots(self): | |
248 |
|
248 | |||
249 | ncol = 4 |
|
249 | ncol = 4 | |
250 | nrow = self.nplots |
|
250 | nrow = self.nplots | |
251 |
|
251 | |||
252 | return nrow, ncol |
|
252 | return nrow, ncol | |
253 |
|
253 | |||
254 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
254 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
255 |
|
255 | |||
256 | self.__showprofile = showprofile |
|
256 | self.__showprofile = showprofile | |
257 | self.nplots = nplots |
|
257 | self.nplots = nplots | |
258 |
|
258 | |||
259 | ncolspan = 1 |
|
259 | ncolspan = 1 | |
260 | colspan = 1 |
|
260 | colspan = 1 | |
261 |
|
261 | |||
262 | self.createFigure(id = id, |
|
262 | self.createFigure(id = id, | |
263 | wintitle = wintitle, |
|
263 | wintitle = wintitle, | |
264 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
264 | widthplot = self.WIDTH + self.WIDTHPROF, | |
265 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
265 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
266 | show=True) |
|
266 | show=True) | |
267 |
|
267 | |||
268 | nrow, ncol = self.getSubplots() |
|
268 | nrow, ncol = self.getSubplots() | |
269 |
|
269 | |||
270 | counter = 0 |
|
270 | counter = 0 | |
271 | for y in range(nrow): |
|
271 | for y in range(nrow): | |
272 | for x in range(ncol): |
|
272 | for x in range(ncol): | |
273 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
273 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
274 |
|
274 | |||
275 | counter += 1 |
|
275 | counter += 1 | |
276 |
|
276 | |||
277 | def run(self, dataOut, id, wintitle="", pairsList=None, |
|
277 | def run(self, dataOut, id, wintitle="", pairsList=None, | |
278 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, |
|
278 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
279 | coh_min=None, coh_max=None, phase_min=None, phase_max=None, |
|
279 | coh_min=None, coh_max=None, phase_min=None, phase_max=None, | |
280 | save=False, figpath='./', figfile=None, ftp=False, wr_period=1, |
|
280 | save=False, figpath='./', figfile=None, ftp=False, wr_period=1, | |
281 | power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r', show=True, |
|
281 | power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r', show=True, | |
282 | server=None, folder=None, username=None, password=None, |
|
282 | server=None, folder=None, username=None, password=None, | |
283 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
283 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
284 |
|
284 | |||
285 | """ |
|
285 | """ | |
286 |
|
286 | |||
287 | Input: |
|
287 | Input: | |
288 | dataOut : |
|
288 | dataOut : | |
289 | id : |
|
289 | id : | |
290 | wintitle : |
|
290 | wintitle : | |
291 | channelList : |
|
291 | channelList : | |
292 | showProfile : |
|
292 | showProfile : | |
293 | xmin : None, |
|
293 | xmin : None, | |
294 | xmax : None, |
|
294 | xmax : None, | |
295 | ymin : None, |
|
295 | ymin : None, | |
296 | ymax : None, |
|
296 | ymax : None, | |
297 | zmin : None, |
|
297 | zmin : None, | |
298 | zmax : None |
|
298 | zmax : None | |
299 | """ |
|
299 | """ | |
300 |
|
300 | |||
301 | if pairsList == None: |
|
301 | if pairsList == None: | |
302 | pairsIndexList = dataOut.pairsIndexList |
|
302 | pairsIndexList = dataOut.pairsIndexList | |
303 | else: |
|
303 | else: | |
304 | pairsIndexList = [] |
|
304 | pairsIndexList = [] | |
305 | for pair in pairsList: |
|
305 | for pair in pairsList: | |
306 | if pair not in dataOut.pairsList: |
|
306 | if pair not in dataOut.pairsList: | |
307 | raise ValueError, "Pair %s is not in dataOut.pairsList" %str(pair) |
|
307 | raise ValueError, "Pair %s is not in dataOut.pairsList" %str(pair) | |
308 | pairsIndexList.append(dataOut.pairsList.index(pair)) |
|
308 | pairsIndexList.append(dataOut.pairsList.index(pair)) | |
309 |
|
309 | |||
310 | if not pairsIndexList: |
|
310 | if not pairsIndexList: | |
311 | return |
|
311 | return | |
312 |
|
312 | |||
313 | if len(pairsIndexList) > 4: |
|
313 | if len(pairsIndexList) > 4: | |
314 | pairsIndexList = pairsIndexList[0:4] |
|
314 | pairsIndexList = pairsIndexList[0:4] | |
315 |
|
315 | |||
316 | factor = dataOut.normFactor |
|
316 | factor = dataOut.normFactor | |
317 | x = dataOut.getVelRange(1) |
|
317 | x = dataOut.getVelRange(1) | |
318 | y = dataOut.getHeiRange() |
|
318 | y = dataOut.getHeiRange() | |
319 | z = dataOut.data_spc[:,:,:]/factor |
|
319 | z = dataOut.data_spc[:,:,:]/factor | |
320 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
320 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) | |
321 |
|
321 | |||
322 | noise = dataOut.noise/factor |
|
322 | noise = dataOut.noise/factor | |
323 |
|
323 | |||
324 | zdB = 10*numpy.log10(z) |
|
324 | zdB = 10*numpy.log10(z) | |
325 | noisedB = 10*numpy.log10(noise) |
|
325 | noisedB = 10*numpy.log10(noise) | |
326 |
|
326 | |||
327 | if coh_min == None: |
|
327 | if coh_min == None: | |
328 | coh_min = 0.0 |
|
328 | coh_min = 0.0 | |
329 | if coh_max == None: |
|
329 | if coh_max == None: | |
330 | coh_max = 1.0 |
|
330 | coh_max = 1.0 | |
331 |
|
331 | |||
332 | if phase_min == None: |
|
332 | if phase_min == None: | |
333 | phase_min = -180 |
|
333 | phase_min = -180 | |
334 | if phase_max == None: |
|
334 | if phase_max == None: | |
335 | phase_max = 180 |
|
335 | phase_max = 180 | |
336 |
|
336 | |||
337 | #thisDatetime = dataOut.datatime |
|
337 | #thisDatetime = dataOut.datatime | |
338 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
338 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
339 | title = wintitle + " Cross-Spectra: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
339 | title = wintitle + " Cross-Spectra: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
340 | xlabel = "Velocity (m/s)" |
|
340 | xlabel = "Velocity (m/s)" | |
341 | ylabel = "Range (Km)" |
|
341 | ylabel = "Range (Km)" | |
342 |
|
342 | |||
343 | if not self.isConfig: |
|
343 | if not self.isConfig: | |
344 |
|
344 | |||
345 | nplots = len(pairsIndexList) |
|
345 | nplots = len(pairsIndexList) | |
346 |
|
346 | |||
347 | self.setup(id=id, |
|
347 | self.setup(id=id, | |
348 | nplots=nplots, |
|
348 | nplots=nplots, | |
349 | wintitle=wintitle, |
|
349 | wintitle=wintitle, | |
350 | showprofile=False, |
|
350 | showprofile=False, | |
351 | show=show) |
|
351 | show=show) | |
352 |
|
352 | |||
353 | avg = numpy.abs(numpy.average(z, axis=1)) |
|
353 | avg = numpy.abs(numpy.average(z, axis=1)) | |
354 | avgdB = 10*numpy.log10(avg) |
|
354 | avgdB = 10*numpy.log10(avg) | |
355 |
|
355 | |||
356 | if xmin == None: xmin = numpy.nanmin(x) |
|
356 | if xmin == None: xmin = numpy.nanmin(x) | |
357 | if xmax == None: xmax = numpy.nanmax(x) |
|
357 | if xmax == None: xmax = numpy.nanmax(x) | |
358 | if ymin == None: ymin = numpy.nanmin(y) |
|
358 | if ymin == None: ymin = numpy.nanmin(y) | |
359 | if ymax == None: ymax = numpy.nanmax(y) |
|
359 | if ymax == None: ymax = numpy.nanmax(y) | |
360 | if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3 |
|
360 | if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3 | |
361 | if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3 |
|
361 | if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3 | |
362 |
|
362 | |||
363 | self.FTP_WEI = ftp_wei |
|
363 | self.FTP_WEI = ftp_wei | |
364 | self.EXP_CODE = exp_code |
|
364 | self.EXP_CODE = exp_code | |
365 | self.SUB_EXP_CODE = sub_exp_code |
|
365 | self.SUB_EXP_CODE = sub_exp_code | |
366 | self.PLOT_POS = plot_pos |
|
366 | self.PLOT_POS = plot_pos | |
367 |
|
367 | |||
368 | self.isConfig = True |
|
368 | self.isConfig = True | |
369 |
|
369 | |||
370 | self.setWinTitle(title) |
|
370 | self.setWinTitle(title) | |
371 |
|
371 | |||
372 | for i in range(self.nplots): |
|
372 | for i in range(self.nplots): | |
373 | pair = dataOut.pairsList[pairsIndexList[i]] |
|
373 | pair = dataOut.pairsList[pairsIndexList[i]] | |
374 |
|
374 | |||
375 | chan_index0 = dataOut.channelList.index(pair[0]) |
|
375 | chan_index0 = dataOut.channelList.index(pair[0]) | |
376 | chan_index1 = dataOut.channelList.index(pair[1]) |
|
376 | chan_index1 = dataOut.channelList.index(pair[1]) | |
377 |
|
377 | |||
378 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
378 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) | |
379 | title = "Ch%d: %4.2fdB: %s" %(pair[0], noisedB[chan_index0], str_datetime) |
|
379 | title = "Ch%d: %4.2fdB: %s" %(pair[0], noisedB[chan_index0], str_datetime) | |
380 | zdB = 10.*numpy.log10(dataOut.data_spc[chan_index0,:,:]/factor) |
|
380 | zdB = 10.*numpy.log10(dataOut.data_spc[chan_index0,:,:]/factor) | |
381 | axes0 = self.axesList[i*self.__nsubplots] |
|
381 | axes0 = self.axesList[i*self.__nsubplots] | |
382 | axes0.pcolor(x, y, zdB, |
|
382 | axes0.pcolor(x, y, zdB, | |
383 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
383 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
384 | xlabel=xlabel, ylabel=ylabel, title=title, |
|
384 | xlabel=xlabel, ylabel=ylabel, title=title, | |
385 | ticksize=9, colormap=power_cmap, cblabel='') |
|
385 | ticksize=9, colormap=power_cmap, cblabel='') | |
386 |
|
386 | |||
387 | title = "Ch%d: %4.2fdB: %s" %(pair[1], noisedB[chan_index1], str_datetime) |
|
387 | title = "Ch%d: %4.2fdB: %s" %(pair[1], noisedB[chan_index1], str_datetime) | |
388 | zdB = 10.*numpy.log10(dataOut.data_spc[chan_index1,:,:]/factor) |
|
388 | zdB = 10.*numpy.log10(dataOut.data_spc[chan_index1,:,:]/factor) | |
389 | axes0 = self.axesList[i*self.__nsubplots+1] |
|
389 | axes0 = self.axesList[i*self.__nsubplots+1] | |
390 | axes0.pcolor(x, y, zdB, |
|
390 | axes0.pcolor(x, y, zdB, | |
391 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
391 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
392 | xlabel=xlabel, ylabel=ylabel, title=title, |
|
392 | xlabel=xlabel, ylabel=ylabel, title=title, | |
393 | ticksize=9, colormap=power_cmap, cblabel='') |
|
393 | ticksize=9, colormap=power_cmap, cblabel='') | |
394 |
|
394 | |||
395 | coherenceComplex = dataOut.data_cspc[pairsIndexList[i],:,:]/numpy.sqrt(dataOut.data_spc[chan_index0,:,:]*dataOut.data_spc[chan_index1,:,:]) |
|
395 | coherenceComplex = dataOut.data_cspc[pairsIndexList[i],:,:]/numpy.sqrt(dataOut.data_spc[chan_index0,:,:]*dataOut.data_spc[chan_index1,:,:]) | |
396 | coherence = numpy.abs(coherenceComplex) |
|
396 | coherence = numpy.abs(coherenceComplex) | |
397 | # phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi |
|
397 | # phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi | |
398 | phase = numpy.arctan2(coherenceComplex.imag, coherenceComplex.real)*180/numpy.pi |
|
398 | phase = numpy.arctan2(coherenceComplex.imag, coherenceComplex.real)*180/numpy.pi | |
399 |
|
399 | |||
400 | title = "Coherence Ch%d * Ch%d" %(pair[0], pair[1]) |
|
400 | title = "Coherence Ch%d * Ch%d" %(pair[0], pair[1]) | |
401 | axes0 = self.axesList[i*self.__nsubplots+2] |
|
401 | axes0 = self.axesList[i*self.__nsubplots+2] | |
402 | axes0.pcolor(x, y, coherence, |
|
402 | axes0.pcolor(x, y, coherence, | |
403 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=coh_min, zmax=coh_max, |
|
403 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=coh_min, zmax=coh_max, | |
404 | xlabel=xlabel, ylabel=ylabel, title=title, |
|
404 | xlabel=xlabel, ylabel=ylabel, title=title, | |
405 | ticksize=9, colormap=coherence_cmap, cblabel='') |
|
405 | ticksize=9, colormap=coherence_cmap, cblabel='') | |
406 |
|
406 | |||
407 | title = "Phase Ch%d * Ch%d" %(pair[0], pair[1]) |
|
407 | title = "Phase Ch%d * Ch%d" %(pair[0], pair[1]) | |
408 | axes0 = self.axesList[i*self.__nsubplots+3] |
|
408 | axes0 = self.axesList[i*self.__nsubplots+3] | |
409 | axes0.pcolor(x, y, phase, |
|
409 | axes0.pcolor(x, y, phase, | |
410 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=phase_min, zmax=phase_max, |
|
410 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=phase_min, zmax=phase_max, | |
411 | xlabel=xlabel, ylabel=ylabel, title=title, |
|
411 | xlabel=xlabel, ylabel=ylabel, title=title, | |
412 | ticksize=9, colormap=phase_cmap, cblabel='') |
|
412 | ticksize=9, colormap=phase_cmap, cblabel='') | |
413 |
|
413 | |||
414 |
|
414 | |||
415 |
|
415 | |||
416 | self.draw() |
|
416 | self.draw() | |
417 |
|
417 | |||
418 | self.save(figpath=figpath, |
|
418 | self.save(figpath=figpath, | |
419 | figfile=figfile, |
|
419 | figfile=figfile, | |
420 | save=save, |
|
420 | save=save, | |
421 | ftp=ftp, |
|
421 | ftp=ftp, | |
422 | wr_period=wr_period, |
|
422 | wr_period=wr_period, | |
423 | thisDatetime=thisDatetime) |
|
423 | thisDatetime=thisDatetime) | |
424 |
|
424 | |||
425 |
|
425 | |||
426 | class RTIPlot(Figure): |
|
426 | class RTIPlot(Figure): | |
427 |
|
427 | |||
428 | __isConfig = None |
|
428 | __isConfig = None | |
429 | __nsubplots = None |
|
429 | __nsubplots = None | |
430 |
|
430 | |||
431 | WIDTHPROF = None |
|
431 | WIDTHPROF = None | |
432 | HEIGHTPROF = None |
|
432 | HEIGHTPROF = None | |
433 | PREFIX = 'rti' |
|
433 | PREFIX = 'rti' | |
434 |
|
434 | |||
435 | def __init__(self): |
|
435 | def __init__(self): | |
436 |
|
436 | |||
437 | self.timerange = None |
|
437 | self.timerange = None | |
438 | self.isConfig = False |
|
438 | self.isConfig = False | |
439 | self.__nsubplots = 1 |
|
439 | self.__nsubplots = 1 | |
440 |
|
440 | |||
441 | self.WIDTH = 800 |
|
441 | self.WIDTH = 800 | |
442 | self.HEIGHT = 180 |
|
442 | self.HEIGHT = 180 | |
443 | self.WIDTHPROF = 120 |
|
443 | self.WIDTHPROF = 120 | |
444 | self.HEIGHTPROF = 0 |
|
444 | self.HEIGHTPROF = 0 | |
445 | self.counter_imagwr = 0 |
|
445 | self.counter_imagwr = 0 | |
446 |
|
446 | |||
447 | self.PLOT_CODE = RTI_CODE |
|
447 | self.PLOT_CODE = RTI_CODE | |
448 |
|
448 | |||
449 | self.FTP_WEI = None |
|
449 | self.FTP_WEI = None | |
450 | self.EXP_CODE = None |
|
450 | self.EXP_CODE = None | |
451 | self.SUB_EXP_CODE = None |
|
451 | self.SUB_EXP_CODE = None | |
452 | self.PLOT_POS = None |
|
452 | self.PLOT_POS = None | |
453 | self.tmin = None |
|
453 | self.tmin = None | |
454 | self.tmax = None |
|
454 | self.tmax = None | |
455 |
|
455 | |||
456 | self.xmin = None |
|
456 | self.xmin = None | |
457 | self.xmax = None |
|
457 | self.xmax = None | |
458 |
|
458 | |||
459 | self.figfile = None |
|
459 | self.figfile = None | |
460 |
|
460 | |||
461 | def getSubplots(self): |
|
461 | def getSubplots(self): | |
462 |
|
462 | |||
463 | ncol = 1 |
|
463 | ncol = 1 | |
464 | nrow = self.nplots |
|
464 | nrow = self.nplots | |
465 |
|
465 | |||
466 | return nrow, ncol |
|
466 | return nrow, ncol | |
467 |
|
467 | |||
468 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
468 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
469 |
|
469 | |||
470 | self.__showprofile = showprofile |
|
470 | self.__showprofile = showprofile | |
471 | self.nplots = nplots |
|
471 | self.nplots = nplots | |
472 |
|
472 | |||
473 | ncolspan = 1 |
|
473 | ncolspan = 1 | |
474 | colspan = 1 |
|
474 | colspan = 1 | |
475 | if showprofile: |
|
475 | if showprofile: | |
476 | ncolspan = 7 |
|
476 | ncolspan = 7 | |
477 | colspan = 6 |
|
477 | colspan = 6 | |
478 | self.__nsubplots = 2 |
|
478 | self.__nsubplots = 2 | |
479 |
|
479 | |||
480 | self.createFigure(id = id, |
|
480 | self.createFigure(id = id, | |
481 | wintitle = wintitle, |
|
481 | wintitle = wintitle, | |
482 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
482 | widthplot = self.WIDTH + self.WIDTHPROF, | |
483 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
483 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
484 | show=show) |
|
484 | show=show) | |
485 |
|
485 | |||
486 | nrow, ncol = self.getSubplots() |
|
486 | nrow, ncol = self.getSubplots() | |
487 |
|
487 | |||
488 | counter = 0 |
|
488 | counter = 0 | |
489 | for y in range(nrow): |
|
489 | for y in range(nrow): | |
490 | for x in range(ncol): |
|
490 | for x in range(ncol): | |
491 |
|
491 | |||
492 | if counter >= self.nplots: |
|
492 | if counter >= self.nplots: | |
493 | break |
|
493 | break | |
494 |
|
494 | |||
495 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
495 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
496 |
|
496 | |||
497 | if showprofile: |
|
497 | if showprofile: | |
498 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) |
|
498 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) | |
499 |
|
499 | |||
500 | counter += 1 |
|
500 | counter += 1 | |
501 |
|
501 | |||
502 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True', |
|
502 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True', | |
503 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, |
|
503 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
504 | timerange=None, |
|
504 | timerange=None, | |
505 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, |
|
505 | save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True, | |
506 | server=None, folder=None, username=None, password=None, |
|
506 | server=None, folder=None, username=None, password=None, | |
507 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
507 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
508 |
|
508 | |||
509 | """ |
|
509 | """ | |
510 |
|
510 | |||
511 | Input: |
|
511 | Input: | |
512 | dataOut : |
|
512 | dataOut : | |
513 | id : |
|
513 | id : | |
514 | wintitle : |
|
514 | wintitle : | |
515 | channelList : |
|
515 | channelList : | |
516 | showProfile : |
|
516 | showProfile : | |
517 | xmin : None, |
|
517 | xmin : None, | |
518 | xmax : None, |
|
518 | xmax : None, | |
519 | ymin : None, |
|
519 | ymin : None, | |
520 | ymax : None, |
|
520 | ymax : None, | |
521 | zmin : None, |
|
521 | zmin : None, | |
522 | zmax : None |
|
522 | zmax : None | |
523 | """ |
|
523 | """ | |
524 |
|
524 | |||
525 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): |
|
525 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): | |
526 | return |
|
526 | return | |
527 |
|
527 | |||
528 | if channelList == None: |
|
528 | if channelList == None: | |
529 | channelIndexList = dataOut.channelIndexList |
|
529 | channelIndexList = dataOut.channelIndexList | |
530 | else: |
|
530 | else: | |
531 | channelIndexList = [] |
|
531 | channelIndexList = [] | |
532 | for channel in channelList: |
|
532 | for channel in channelList: | |
533 | if channel not in dataOut.channelList: |
|
533 | if channel not in dataOut.channelList: | |
534 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
534 | raise ValueError, "Channel %d is not in dataOut.channelList" | |
535 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
535 | channelIndexList.append(dataOut.channelList.index(channel)) | |
536 |
|
536 | |||
537 | factor = dataOut.normFactor |
|
537 | factor = dataOut.normFactor | |
538 | x = dataOut.getTimeRange() |
|
538 | x = dataOut.getTimeRange() | |
539 | y = dataOut.getHeiRange() |
|
539 | y = dataOut.getHeiRange() | |
540 |
|
540 | |||
541 | z = dataOut.data_spc/factor |
|
541 | z = dataOut.data_spc/factor | |
542 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
542 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) | |
543 | avg = numpy.average(z, axis=1) |
|
543 | avg = numpy.average(z, axis=1) | |
544 |
|
544 | |||
545 | avgdB = 10.*numpy.log10(avg) |
|
545 | avgdB = 10.*numpy.log10(avg) | |
546 |
|
546 | |||
547 | thisDatetime = dataOut.datatime |
|
547 | thisDatetime = dataOut.datatime | |
548 | # thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
548 | # thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
549 | title = wintitle + " RTI" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
549 | title = wintitle + " RTI" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
550 | xlabel = "" |
|
550 | xlabel = "" | |
551 | ylabel = "Range (Km)" |
|
551 | ylabel = "Range (Km)" | |
552 |
|
552 | |||
553 | update_figfile = False |
|
553 | update_figfile = False | |
554 |
|
554 | |||
|
555 | if dataOut.ltctime >= self.xmax: | |||
|
556 | self.counter_imagwr = wr_period | |||
|
557 | self.isConfig = False | |||
|
558 | update_figfile = True | |||
|
559 | ||||
555 | if not self.isConfig: |
|
560 | if not self.isConfig: | |
556 |
|
561 | |||
557 | nplots = len(channelIndexList) |
|
562 | nplots = len(channelIndexList) | |
558 |
|
563 | |||
559 | self.setup(id=id, |
|
564 | self.setup(id=id, | |
560 | nplots=nplots, |
|
565 | nplots=nplots, | |
561 | wintitle=wintitle, |
|
566 | wintitle=wintitle, | |
562 | showprofile=showprofile, |
|
567 | showprofile=showprofile, | |
563 | show=show) |
|
568 | show=show) | |
564 |
|
569 | |||
565 | if timerange != None: |
|
570 | if timerange != None: | |
566 | self.timerange = timerange |
|
571 | self.timerange = timerange | |
567 |
|
572 | |||
568 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
573 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
569 |
|
574 | |||
570 | noise = dataOut.noise/factor |
|
575 | noise = dataOut.noise/factor | |
571 | noisedB = 10*numpy.log10(noise) |
|
576 | noisedB = 10*numpy.log10(noise) | |
572 |
|
577 | |||
573 | if ymin == None: ymin = numpy.nanmin(y) |
|
578 | if ymin == None: ymin = numpy.nanmin(y) | |
574 | if ymax == None: ymax = numpy.nanmax(y) |
|
579 | if ymax == None: ymax = numpy.nanmax(y) | |
575 | if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3 |
|
580 | if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3 | |
576 | if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3 |
|
581 | if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3 | |
577 |
|
582 | |||
578 | self.FTP_WEI = ftp_wei |
|
583 | self.FTP_WEI = ftp_wei | |
579 | self.EXP_CODE = exp_code |
|
584 | self.EXP_CODE = exp_code | |
580 | self.SUB_EXP_CODE = sub_exp_code |
|
585 | self.SUB_EXP_CODE = sub_exp_code | |
581 | self.PLOT_POS = plot_pos |
|
586 | self.PLOT_POS = plot_pos | |
582 |
|
587 | |||
583 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
588 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
584 | self.isConfig = True |
|
589 | self.isConfig = True | |
585 | self.figfile = figfile |
|
590 | self.figfile = figfile | |
586 | update_figfile = True |
|
591 | update_figfile = True | |
587 |
|
592 | |||
588 | self.setWinTitle(title) |
|
593 | self.setWinTitle(title) | |
589 |
|
594 | |||
590 | for i in range(self.nplots): |
|
595 | for i in range(self.nplots): | |
591 | index = channelIndexList[i] |
|
596 | index = channelIndexList[i] | |
592 | title = "Channel %d: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
597 | title = "Channel %d: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
593 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): |
|
598 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
594 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) |
|
599 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) | |
595 | axes = self.axesList[i*self.__nsubplots] |
|
600 | axes = self.axesList[i*self.__nsubplots] | |
596 | zdB = avgdB[index].reshape((1,-1)) |
|
601 | zdB = avgdB[index].reshape((1,-1)) | |
597 | axes.pcolorbuffer(x, y, zdB, |
|
602 | axes.pcolorbuffer(x, y, zdB, | |
598 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
603 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
599 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
604 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
600 | ticksize=9, cblabel='', cbsize="1%") |
|
605 | ticksize=9, cblabel='', cbsize="1%") | |
601 |
|
606 | |||
602 | if self.__showprofile: |
|
607 | if self.__showprofile: | |
603 | axes = self.axesList[i*self.__nsubplots +1] |
|
608 | axes = self.axesList[i*self.__nsubplots +1] | |
604 | axes.pline(avgdB[index], y, |
|
609 | axes.pline(avgdB[index], y, | |
605 | xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax, |
|
610 | xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax, | |
606 | xlabel='dB', ylabel='', title='', |
|
611 | xlabel='dB', ylabel='', title='', | |
607 | ytick_visible=False, |
|
612 | ytick_visible=False, | |
608 | grid='x') |
|
613 | grid='x') | |
609 |
|
614 | |||
610 | self.draw() |
|
615 | self.draw() | |
611 |
|
||||
612 | if dataOut.ltctime >= self.xmax: |
|
|||
613 | self.counter_imagwr = wr_period |
|
|||
614 | self.isConfig = False |
|
|||
615 | update_figfile = True |
|
|||
616 |
|
616 | |||
617 | self.save(figpath=figpath, |
|
617 | self.save(figpath=figpath, | |
618 | figfile=figfile, |
|
618 | figfile=figfile, | |
619 | save=save, |
|
619 | save=save, | |
620 | ftp=ftp, |
|
620 | ftp=ftp, | |
621 | wr_period=wr_period, |
|
621 | wr_period=wr_period, | |
622 | thisDatetime=thisDatetime, |
|
622 | thisDatetime=thisDatetime, | |
623 | update_figfile=update_figfile) |
|
623 | update_figfile=update_figfile) | |
624 |
|
624 | |||
625 | class CoherenceMap(Figure): |
|
625 | class CoherenceMap(Figure): | |
626 | isConfig = None |
|
626 | isConfig = None | |
627 | __nsubplots = None |
|
627 | __nsubplots = None | |
628 |
|
628 | |||
629 | WIDTHPROF = None |
|
629 | WIDTHPROF = None | |
630 | HEIGHTPROF = None |
|
630 | HEIGHTPROF = None | |
631 | PREFIX = 'cmap' |
|
631 | PREFIX = 'cmap' | |
632 |
|
632 | |||
633 | def __init__(self): |
|
633 | def __init__(self): | |
634 | self.timerange = 2*60*60 |
|
634 | self.timerange = 2*60*60 | |
635 | self.isConfig = False |
|
635 | self.isConfig = False | |
636 | self.__nsubplots = 1 |
|
636 | self.__nsubplots = 1 | |
637 |
|
637 | |||
638 | self.WIDTH = 800 |
|
638 | self.WIDTH = 800 | |
639 | self.HEIGHT = 180 |
|
639 | self.HEIGHT = 180 | |
640 | self.WIDTHPROF = 120 |
|
640 | self.WIDTHPROF = 120 | |
641 | self.HEIGHTPROF = 0 |
|
641 | self.HEIGHTPROF = 0 | |
642 | self.counter_imagwr = 0 |
|
642 | self.counter_imagwr = 0 | |
643 |
|
643 | |||
644 | self.PLOT_CODE = COH_CODE |
|
644 | self.PLOT_CODE = COH_CODE | |
645 |
|
645 | |||
646 | self.FTP_WEI = None |
|
646 | self.FTP_WEI = None | |
647 | self.EXP_CODE = None |
|
647 | self.EXP_CODE = None | |
648 | self.SUB_EXP_CODE = None |
|
648 | self.SUB_EXP_CODE = None | |
649 | self.PLOT_POS = None |
|
649 | self.PLOT_POS = None | |
650 | self.counter_imagwr = 0 |
|
650 | self.counter_imagwr = 0 | |
651 |
|
651 | |||
652 | self.xmin = None |
|
652 | self.xmin = None | |
653 | self.xmax = None |
|
653 | self.xmax = None | |
654 |
|
654 | |||
655 | def getSubplots(self): |
|
655 | def getSubplots(self): | |
656 | ncol = 1 |
|
656 | ncol = 1 | |
657 | nrow = self.nplots*2 |
|
657 | nrow = self.nplots*2 | |
658 |
|
658 | |||
659 | return nrow, ncol |
|
659 | return nrow, ncol | |
660 |
|
660 | |||
661 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
661 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
662 | self.__showprofile = showprofile |
|
662 | self.__showprofile = showprofile | |
663 | self.nplots = nplots |
|
663 | self.nplots = nplots | |
664 |
|
664 | |||
665 | ncolspan = 1 |
|
665 | ncolspan = 1 | |
666 | colspan = 1 |
|
666 | colspan = 1 | |
667 | if showprofile: |
|
667 | if showprofile: | |
668 | ncolspan = 7 |
|
668 | ncolspan = 7 | |
669 | colspan = 6 |
|
669 | colspan = 6 | |
670 | self.__nsubplots = 2 |
|
670 | self.__nsubplots = 2 | |
671 |
|
671 | |||
672 | self.createFigure(id = id, |
|
672 | self.createFigure(id = id, | |
673 | wintitle = wintitle, |
|
673 | wintitle = wintitle, | |
674 | widthplot = self.WIDTH + self.WIDTHPROF, |
|
674 | widthplot = self.WIDTH + self.WIDTHPROF, | |
675 | heightplot = self.HEIGHT + self.HEIGHTPROF, |
|
675 | heightplot = self.HEIGHT + self.HEIGHTPROF, | |
676 | show=True) |
|
676 | show=True) | |
677 |
|
677 | |||
678 | nrow, ncol = self.getSubplots() |
|
678 | nrow, ncol = self.getSubplots() | |
679 |
|
679 | |||
680 | for y in range(nrow): |
|
680 | for y in range(nrow): | |
681 | for x in range(ncol): |
|
681 | for x in range(ncol): | |
682 |
|
682 | |||
683 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
683 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
684 |
|
684 | |||
685 | if showprofile: |
|
685 | if showprofile: | |
686 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) |
|
686 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1) | |
687 |
|
687 | |||
688 | def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True', |
|
688 | def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True', | |
689 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, |
|
689 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, | |
690 | timerange=None, phase_min=None, phase_max=None, |
|
690 | timerange=None, phase_min=None, phase_max=None, | |
691 | save=False, figpath='./', figfile=None, ftp=False, wr_period=1, |
|
691 | save=False, figpath='./', figfile=None, ftp=False, wr_period=1, | |
692 | coherence_cmap='jet', phase_cmap='RdBu_r', show=True, |
|
692 | coherence_cmap='jet', phase_cmap='RdBu_r', show=True, | |
693 | server=None, folder=None, username=None, password=None, |
|
693 | server=None, folder=None, username=None, password=None, | |
694 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
694 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
695 |
|
695 | |||
696 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): |
|
696 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): | |
697 | return |
|
697 | return | |
698 |
|
698 | |||
699 | if pairsList == None: |
|
699 | if pairsList == None: | |
700 | pairsIndexList = dataOut.pairsIndexList |
|
700 | pairsIndexList = dataOut.pairsIndexList | |
701 | else: |
|
701 | else: | |
702 | pairsIndexList = [] |
|
702 | pairsIndexList = [] | |
703 | for pair in pairsList: |
|
703 | for pair in pairsList: | |
704 | if pair not in dataOut.pairsList: |
|
704 | if pair not in dataOut.pairsList: | |
705 | raise ValueError, "Pair %s is not in dataOut.pairsList" %(pair) |
|
705 | raise ValueError, "Pair %s is not in dataOut.pairsList" %(pair) | |
706 | pairsIndexList.append(dataOut.pairsList.index(pair)) |
|
706 | pairsIndexList.append(dataOut.pairsList.index(pair)) | |
707 |
|
707 | |||
708 | if pairsIndexList == []: |
|
708 | if pairsIndexList == []: | |
709 | return |
|
709 | return | |
710 |
|
710 | |||
711 | if len(pairsIndexList) > 4: |
|
711 | if len(pairsIndexList) > 4: | |
712 | pairsIndexList = pairsIndexList[0:4] |
|
712 | pairsIndexList = pairsIndexList[0:4] | |
713 |
|
713 | |||
714 | if phase_min == None: |
|
714 | if phase_min == None: | |
715 | phase_min = -180 |
|
715 | phase_min = -180 | |
716 | if phase_max == None: |
|
716 | if phase_max == None: | |
717 | phase_max = 180 |
|
717 | phase_max = 180 | |
718 |
|
718 | |||
719 | x = dataOut.getTimeRange() |
|
719 | x = dataOut.getTimeRange() | |
720 | y = dataOut.getHeiRange() |
|
720 | y = dataOut.getHeiRange() | |
721 |
|
721 | |||
722 | thisDatetime = dataOut.datatime |
|
722 | thisDatetime = dataOut.datatime | |
723 |
|
723 | |||
724 | title = wintitle + " CoherenceMap" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
724 | title = wintitle + " CoherenceMap" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
725 | xlabel = "" |
|
725 | xlabel = "" | |
726 | ylabel = "Range (Km)" |
|
726 | ylabel = "Range (Km)" | |
727 | update_figfile = False |
|
727 | update_figfile = False | |
728 |
|
728 | |||
729 | if not self.isConfig: |
|
729 | if not self.isConfig: | |
730 | nplots = len(pairsIndexList) |
|
730 | nplots = len(pairsIndexList) | |
731 | self.setup(id=id, |
|
731 | self.setup(id=id, | |
732 | nplots=nplots, |
|
732 | nplots=nplots, | |
733 | wintitle=wintitle, |
|
733 | wintitle=wintitle, | |
734 | showprofile=showprofile, |
|
734 | showprofile=showprofile, | |
735 | show=show) |
|
735 | show=show) | |
736 |
|
736 | |||
737 | if timerange != None: |
|
737 | if timerange != None: | |
738 | self.timerange = timerange |
|
738 | self.timerange = timerange | |
739 |
|
739 | |||
740 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
740 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
741 |
|
741 | |||
742 | if ymin == None: ymin = numpy.nanmin(y) |
|
742 | if ymin == None: ymin = numpy.nanmin(y) | |
743 | if ymax == None: ymax = numpy.nanmax(y) |
|
743 | if ymax == None: ymax = numpy.nanmax(y) | |
744 | if zmin == None: zmin = 0. |
|
744 | if zmin == None: zmin = 0. | |
745 | if zmax == None: zmax = 1. |
|
745 | if zmax == None: zmax = 1. | |
746 |
|
746 | |||
747 | self.FTP_WEI = ftp_wei |
|
747 | self.FTP_WEI = ftp_wei | |
748 | self.EXP_CODE = exp_code |
|
748 | self.EXP_CODE = exp_code | |
749 | self.SUB_EXP_CODE = sub_exp_code |
|
749 | self.SUB_EXP_CODE = sub_exp_code | |
750 | self.PLOT_POS = plot_pos |
|
750 | self.PLOT_POS = plot_pos | |
751 |
|
751 | |||
752 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
752 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
753 |
|
753 | |||
754 | self.isConfig = True |
|
754 | self.isConfig = True | |
755 | update_figfile = True |
|
755 | update_figfile = True | |
756 |
|
756 | |||
757 | self.setWinTitle(title) |
|
757 | self.setWinTitle(title) | |
758 |
|
758 | |||
759 | for i in range(self.nplots): |
|
759 | for i in range(self.nplots): | |
760 |
|
760 | |||
761 | pair = dataOut.pairsList[pairsIndexList[i]] |
|
761 | pair = dataOut.pairsList[pairsIndexList[i]] | |
762 |
|
762 | |||
763 | ccf = numpy.average(dataOut.data_cspc[pairsIndexList[i],:,:],axis=0) |
|
763 | ccf = numpy.average(dataOut.data_cspc[pairsIndexList[i],:,:],axis=0) | |
764 | powa = numpy.average(dataOut.data_spc[pair[0],:,:],axis=0) |
|
764 | powa = numpy.average(dataOut.data_spc[pair[0],:,:],axis=0) | |
765 | powb = numpy.average(dataOut.data_spc[pair[1],:,:],axis=0) |
|
765 | powb = numpy.average(dataOut.data_spc[pair[1],:,:],axis=0) | |
766 |
|
766 | |||
767 |
|
767 | |||
768 | avgcoherenceComplex = ccf/numpy.sqrt(powa*powb) |
|
768 | avgcoherenceComplex = ccf/numpy.sqrt(powa*powb) | |
769 | coherence = numpy.abs(avgcoherenceComplex) |
|
769 | coherence = numpy.abs(avgcoherenceComplex) | |
770 |
|
770 | |||
771 | z = coherence.reshape((1,-1)) |
|
771 | z = coherence.reshape((1,-1)) | |
772 |
|
772 | |||
773 | counter = 0 |
|
773 | counter = 0 | |
774 |
|
774 | |||
775 | title = "Coherence Ch%d * Ch%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
775 | title = "Coherence Ch%d * Ch%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
776 | axes = self.axesList[i*self.__nsubplots*2] |
|
776 | axes = self.axesList[i*self.__nsubplots*2] | |
777 | axes.pcolorbuffer(x, y, z, |
|
777 | axes.pcolorbuffer(x, y, z, | |
778 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
778 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
779 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
779 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
780 | ticksize=9, cblabel='', colormap=coherence_cmap, cbsize="1%") |
|
780 | ticksize=9, cblabel='', colormap=coherence_cmap, cbsize="1%") | |
781 |
|
781 | |||
782 | if self.__showprofile: |
|
782 | if self.__showprofile: | |
783 | counter += 1 |
|
783 | counter += 1 | |
784 | axes = self.axesList[i*self.__nsubplots*2 + counter] |
|
784 | axes = self.axesList[i*self.__nsubplots*2 + counter] | |
785 | axes.pline(coherence, y, |
|
785 | axes.pline(coherence, y, | |
786 | xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax, |
|
786 | xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax, | |
787 | xlabel='', ylabel='', title='', ticksize=7, |
|
787 | xlabel='', ylabel='', title='', ticksize=7, | |
788 | ytick_visible=False, nxticks=5, |
|
788 | ytick_visible=False, nxticks=5, | |
789 | grid='x') |
|
789 | grid='x') | |
790 |
|
790 | |||
791 | counter += 1 |
|
791 | counter += 1 | |
792 |
|
792 | |||
793 | phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi |
|
793 | phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi | |
794 |
|
794 | |||
795 | z = phase.reshape((1,-1)) |
|
795 | z = phase.reshape((1,-1)) | |
796 |
|
796 | |||
797 | title = "Phase Ch%d * Ch%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
797 | title = "Phase Ch%d * Ch%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
798 | axes = self.axesList[i*self.__nsubplots*2 + counter] |
|
798 | axes = self.axesList[i*self.__nsubplots*2 + counter] | |
799 | axes.pcolorbuffer(x, y, z, |
|
799 | axes.pcolorbuffer(x, y, z, | |
800 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=phase_min, zmax=phase_max, |
|
800 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=phase_min, zmax=phase_max, | |
801 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
801 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
802 | ticksize=9, cblabel='', colormap=phase_cmap, cbsize="1%") |
|
802 | ticksize=9, cblabel='', colormap=phase_cmap, cbsize="1%") | |
803 |
|
803 | |||
804 | if self.__showprofile: |
|
804 | if self.__showprofile: | |
805 | counter += 1 |
|
805 | counter += 1 | |
806 | axes = self.axesList[i*self.__nsubplots*2 + counter] |
|
806 | axes = self.axesList[i*self.__nsubplots*2 + counter] | |
807 | axes.pline(phase, y, |
|
807 | axes.pline(phase, y, | |
808 | xmin=phase_min, xmax=phase_max, ymin=ymin, ymax=ymax, |
|
808 | xmin=phase_min, xmax=phase_max, ymin=ymin, ymax=ymax, | |
809 | xlabel='', ylabel='', title='', ticksize=7, |
|
809 | xlabel='', ylabel='', title='', ticksize=7, | |
810 | ytick_visible=False, nxticks=4, |
|
810 | ytick_visible=False, nxticks=4, | |
811 | grid='x') |
|
811 | grid='x') | |
812 |
|
812 | |||
813 | self.draw() |
|
813 | self.draw() | |
814 |
|
814 | |||
815 | if dataOut.ltctime >= self.xmax: |
|
815 | if dataOut.ltctime >= self.xmax: | |
816 | self.counter_imagwr = wr_period |
|
816 | self.counter_imagwr = wr_period | |
817 | self.isConfig = False |
|
817 | self.isConfig = False | |
818 | update_figfile = True |
|
818 | update_figfile = True | |
819 |
|
819 | |||
820 | self.save(figpath=figpath, |
|
820 | self.save(figpath=figpath, | |
821 | figfile=figfile, |
|
821 | figfile=figfile, | |
822 | save=save, |
|
822 | save=save, | |
823 | ftp=ftp, |
|
823 | ftp=ftp, | |
824 | wr_period=wr_period, |
|
824 | wr_period=wr_period, | |
825 | thisDatetime=thisDatetime, |
|
825 | thisDatetime=thisDatetime, | |
826 | update_figfile=update_figfile) |
|
826 | update_figfile=update_figfile) | |
827 |
|
827 | |||
828 | class PowerProfilePlot(Figure): |
|
828 | class PowerProfilePlot(Figure): | |
829 |
|
829 | |||
830 | isConfig = None |
|
830 | isConfig = None | |
831 | __nsubplots = None |
|
831 | __nsubplots = None | |
832 |
|
832 | |||
833 | WIDTHPROF = None |
|
833 | WIDTHPROF = None | |
834 | HEIGHTPROF = None |
|
834 | HEIGHTPROF = None | |
835 | PREFIX = 'spcprofile' |
|
835 | PREFIX = 'spcprofile' | |
836 |
|
836 | |||
837 | def __init__(self): |
|
837 | def __init__(self): | |
838 | self.isConfig = False |
|
838 | self.isConfig = False | |
839 | self.__nsubplots = 1 |
|
839 | self.__nsubplots = 1 | |
840 |
|
840 | |||
841 | self.PLOT_CODE = POWER_CODE |
|
841 | self.PLOT_CODE = POWER_CODE | |
842 |
|
842 | |||
843 | self.WIDTH = 300 |
|
843 | self.WIDTH = 300 | |
844 | self.HEIGHT = 500 |
|
844 | self.HEIGHT = 500 | |
845 | self.counter_imagwr = 0 |
|
845 | self.counter_imagwr = 0 | |
846 |
|
846 | |||
847 | def getSubplots(self): |
|
847 | def getSubplots(self): | |
848 | ncol = 1 |
|
848 | ncol = 1 | |
849 | nrow = 1 |
|
849 | nrow = 1 | |
850 |
|
850 | |||
851 | return nrow, ncol |
|
851 | return nrow, ncol | |
852 |
|
852 | |||
853 | def setup(self, id, nplots, wintitle, show): |
|
853 | def setup(self, id, nplots, wintitle, show): | |
854 |
|
854 | |||
855 | self.nplots = nplots |
|
855 | self.nplots = nplots | |
856 |
|
856 | |||
857 | ncolspan = 1 |
|
857 | ncolspan = 1 | |
858 | colspan = 1 |
|
858 | colspan = 1 | |
859 |
|
859 | |||
860 | self.createFigure(id = id, |
|
860 | self.createFigure(id = id, | |
861 | wintitle = wintitle, |
|
861 | wintitle = wintitle, | |
862 | widthplot = self.WIDTH, |
|
862 | widthplot = self.WIDTH, | |
863 | heightplot = self.HEIGHT, |
|
863 | heightplot = self.HEIGHT, | |
864 | show=show) |
|
864 | show=show) | |
865 |
|
865 | |||
866 | nrow, ncol = self.getSubplots() |
|
866 | nrow, ncol = self.getSubplots() | |
867 |
|
867 | |||
868 | counter = 0 |
|
868 | counter = 0 | |
869 | for y in range(nrow): |
|
869 | for y in range(nrow): | |
870 | for x in range(ncol): |
|
870 | for x in range(ncol): | |
871 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
871 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
872 |
|
872 | |||
873 | def run(self, dataOut, id, wintitle="", channelList=None, |
|
873 | def run(self, dataOut, id, wintitle="", channelList=None, | |
874 | xmin=None, xmax=None, ymin=None, ymax=None, |
|
874 | xmin=None, xmax=None, ymin=None, ymax=None, | |
875 | save=False, figpath='./', figfile=None, show=True, |
|
875 | save=False, figpath='./', figfile=None, show=True, | |
876 | ftp=False, wr_period=1, server=None, |
|
876 | ftp=False, wr_period=1, server=None, | |
877 | folder=None, username=None, password=None): |
|
877 | folder=None, username=None, password=None): | |
878 |
|
878 | |||
879 |
|
879 | |||
880 | if channelList == None: |
|
880 | if channelList == None: | |
881 | channelIndexList = dataOut.channelIndexList |
|
881 | channelIndexList = dataOut.channelIndexList | |
882 | channelList = dataOut.channelList |
|
882 | channelList = dataOut.channelList | |
883 | else: |
|
883 | else: | |
884 | channelIndexList = [] |
|
884 | channelIndexList = [] | |
885 | for channel in channelList: |
|
885 | for channel in channelList: | |
886 | if channel not in dataOut.channelList: |
|
886 | if channel not in dataOut.channelList: | |
887 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
887 | raise ValueError, "Channel %d is not in dataOut.channelList" | |
888 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
888 | channelIndexList.append(dataOut.channelList.index(channel)) | |
889 |
|
889 | |||
890 | factor = dataOut.normFactor |
|
890 | factor = dataOut.normFactor | |
891 |
|
891 | |||
892 | y = dataOut.getHeiRange() |
|
892 | y = dataOut.getHeiRange() | |
893 |
|
893 | |||
894 | #for voltage |
|
894 | #for voltage | |
895 | if dataOut.type == 'Voltage': |
|
895 | if dataOut.type == 'Voltage': | |
896 | x = dataOut.data[channelIndexList,:] * numpy.conjugate(dataOut.data[channelIndexList,:]) |
|
896 | x = dataOut.data[channelIndexList,:] * numpy.conjugate(dataOut.data[channelIndexList,:]) | |
897 | x = x.real |
|
897 | x = x.real | |
898 | x = numpy.where(numpy.isfinite(x), x, numpy.NAN) |
|
898 | x = numpy.where(numpy.isfinite(x), x, numpy.NAN) | |
899 |
|
899 | |||
900 | #for spectra |
|
900 | #for spectra | |
901 | if dataOut.type == 'Spectra': |
|
901 | if dataOut.type == 'Spectra': | |
902 | x = dataOut.data_spc[channelIndexList,:,:]/factor |
|
902 | x = dataOut.data_spc[channelIndexList,:,:]/factor | |
903 | x = numpy.where(numpy.isfinite(x), x, numpy.NAN) |
|
903 | x = numpy.where(numpy.isfinite(x), x, numpy.NAN) | |
904 | x = numpy.average(x, axis=1) |
|
904 | x = numpy.average(x, axis=1) | |
905 |
|
905 | |||
906 |
|
906 | |||
907 | xdB = 10*numpy.log10(x) |
|
907 | xdB = 10*numpy.log10(x) | |
908 |
|
908 | |||
909 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
909 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
910 | title = wintitle + " Power Profile %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
910 | title = wintitle + " Power Profile %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
911 | xlabel = "dB" |
|
911 | xlabel = "dB" | |
912 | ylabel = "Range (Km)" |
|
912 | ylabel = "Range (Km)" | |
913 |
|
913 | |||
914 | if not self.isConfig: |
|
914 | if not self.isConfig: | |
915 |
|
915 | |||
916 | nplots = 1 |
|
916 | nplots = 1 | |
917 |
|
917 | |||
918 | self.setup(id=id, |
|
918 | self.setup(id=id, | |
919 | nplots=nplots, |
|
919 | nplots=nplots, | |
920 | wintitle=wintitle, |
|
920 | wintitle=wintitle, | |
921 | show=show) |
|
921 | show=show) | |
922 |
|
922 | |||
923 | if ymin == None: ymin = numpy.nanmin(y) |
|
923 | if ymin == None: ymin = numpy.nanmin(y) | |
924 | if ymax == None: ymax = numpy.nanmax(y) |
|
924 | if ymax == None: ymax = numpy.nanmax(y) | |
925 | if xmin == None: xmin = numpy.nanmin(xdB)*0.9 |
|
925 | if xmin == None: xmin = numpy.nanmin(xdB)*0.9 | |
926 | if xmax == None: xmax = numpy.nanmax(xdB)*1.1 |
|
926 | if xmax == None: xmax = numpy.nanmax(xdB)*1.1 | |
927 |
|
927 | |||
928 | self.isConfig = True |
|
928 | self.isConfig = True | |
929 |
|
929 | |||
930 | self.setWinTitle(title) |
|
930 | self.setWinTitle(title) | |
931 |
|
931 | |||
932 | title = "Power Profile: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
932 | title = "Power Profile: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
933 | axes = self.axesList[0] |
|
933 | axes = self.axesList[0] | |
934 |
|
934 | |||
935 | legendlabels = ["channel %d"%x for x in channelList] |
|
935 | legendlabels = ["channel %d"%x for x in channelList] | |
936 | axes.pmultiline(xdB, y, |
|
936 | axes.pmultiline(xdB, y, | |
937 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, |
|
937 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, | |
938 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, |
|
938 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, | |
939 | ytick_visible=True, nxticks=5, |
|
939 | ytick_visible=True, nxticks=5, | |
940 | grid='x') |
|
940 | grid='x') | |
941 |
|
941 | |||
942 | self.draw() |
|
942 | self.draw() | |
943 |
|
943 | |||
944 | self.save(figpath=figpath, |
|
944 | self.save(figpath=figpath, | |
945 | figfile=figfile, |
|
945 | figfile=figfile, | |
946 | save=save, |
|
946 | save=save, | |
947 | ftp=ftp, |
|
947 | ftp=ftp, | |
948 | wr_period=wr_period, |
|
948 | wr_period=wr_period, | |
949 | thisDatetime=thisDatetime) |
|
949 | thisDatetime=thisDatetime) | |
950 |
|
950 | |||
951 | class SpectraCutPlot(Figure): |
|
951 | class SpectraCutPlot(Figure): | |
952 |
|
952 | |||
953 | isConfig = None |
|
953 | isConfig = None | |
954 | __nsubplots = None |
|
954 | __nsubplots = None | |
955 |
|
955 | |||
956 | WIDTHPROF = None |
|
956 | WIDTHPROF = None | |
957 | HEIGHTPROF = None |
|
957 | HEIGHTPROF = None | |
958 | PREFIX = 'spc_cut' |
|
958 | PREFIX = 'spc_cut' | |
959 |
|
959 | |||
960 | def __init__(self): |
|
960 | def __init__(self): | |
961 | self.isConfig = False |
|
961 | self.isConfig = False | |
962 | self.__nsubplots = 1 |
|
962 | self.__nsubplots = 1 | |
963 |
|
963 | |||
964 | self.PLOT_CODE = POWER_CODE |
|
964 | self.PLOT_CODE = POWER_CODE | |
965 |
|
965 | |||
966 | self.WIDTH = 700 |
|
966 | self.WIDTH = 700 | |
967 | self.HEIGHT = 500 |
|
967 | self.HEIGHT = 500 | |
968 | self.counter_imagwr = 0 |
|
968 | self.counter_imagwr = 0 | |
969 |
|
969 | |||
970 | def getSubplots(self): |
|
970 | def getSubplots(self): | |
971 | ncol = 1 |
|
971 | ncol = 1 | |
972 | nrow = 1 |
|
972 | nrow = 1 | |
973 |
|
973 | |||
974 | return nrow, ncol |
|
974 | return nrow, ncol | |
975 |
|
975 | |||
976 | def setup(self, id, nplots, wintitle, show): |
|
976 | def setup(self, id, nplots, wintitle, show): | |
977 |
|
977 | |||
978 | self.nplots = nplots |
|
978 | self.nplots = nplots | |
979 |
|
979 | |||
980 | ncolspan = 1 |
|
980 | ncolspan = 1 | |
981 | colspan = 1 |
|
981 | colspan = 1 | |
982 |
|
982 | |||
983 | self.createFigure(id = id, |
|
983 | self.createFigure(id = id, | |
984 | wintitle = wintitle, |
|
984 | wintitle = wintitle, | |
985 | widthplot = self.WIDTH, |
|
985 | widthplot = self.WIDTH, | |
986 | heightplot = self.HEIGHT, |
|
986 | heightplot = self.HEIGHT, | |
987 | show=show) |
|
987 | show=show) | |
988 |
|
988 | |||
989 | nrow, ncol = self.getSubplots() |
|
989 | nrow, ncol = self.getSubplots() | |
990 |
|
990 | |||
991 | counter = 0 |
|
991 | counter = 0 | |
992 | for y in range(nrow): |
|
992 | for y in range(nrow): | |
993 | for x in range(ncol): |
|
993 | for x in range(ncol): | |
994 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) |
|
994 | self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1) | |
995 |
|
995 | |||
996 | def run(self, dataOut, id, wintitle="", channelList=None, |
|
996 | def run(self, dataOut, id, wintitle="", channelList=None, | |
997 | xmin=None, xmax=None, ymin=None, ymax=None, |
|
997 | xmin=None, xmax=None, ymin=None, ymax=None, | |
998 | save=False, figpath='./', figfile=None, show=True, |
|
998 | save=False, figpath='./', figfile=None, show=True, | |
999 | ftp=False, wr_period=1, server=None, |
|
999 | ftp=False, wr_period=1, server=None, | |
1000 | folder=None, username=None, password=None, |
|
1000 | folder=None, username=None, password=None, | |
1001 | xaxis="velocity"): |
|
1001 | xaxis="velocity"): | |
1002 |
|
1002 | |||
1003 |
|
1003 | |||
1004 | if channelList == None: |
|
1004 | if channelList == None: | |
1005 | channelIndexList = dataOut.channelIndexList |
|
1005 | channelIndexList = dataOut.channelIndexList | |
1006 | channelList = dataOut.channelList |
|
1006 | channelList = dataOut.channelList | |
1007 | else: |
|
1007 | else: | |
1008 | channelIndexList = [] |
|
1008 | channelIndexList = [] | |
1009 | for channel in channelList: |
|
1009 | for channel in channelList: | |
1010 | if channel not in dataOut.channelList: |
|
1010 | if channel not in dataOut.channelList: | |
1011 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
1011 | raise ValueError, "Channel %d is not in dataOut.channelList" | |
1012 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
1012 | channelIndexList.append(dataOut.channelList.index(channel)) | |
1013 |
|
1013 | |||
1014 | factor = dataOut.normFactor |
|
1014 | factor = dataOut.normFactor | |
1015 |
|
1015 | |||
1016 | y = dataOut.getHeiRange() |
|
1016 | y = dataOut.getHeiRange() | |
1017 |
|
1017 | |||
1018 | z = dataOut.data_spc/factor |
|
1018 | z = dataOut.data_spc/factor | |
1019 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
1019 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) | |
1020 |
|
1020 | |||
1021 | hei_index = numpy.arange(25)*3 + 20 |
|
1021 | hei_index = numpy.arange(25)*3 + 20 | |
1022 |
|
1022 | |||
1023 | if xaxis == "frequency": |
|
1023 | if xaxis == "frequency": | |
1024 | x = dataOut.getFreqRange()/1000. |
|
1024 | x = dataOut.getFreqRange()/1000. | |
1025 | zdB = 10*numpy.log10(z[0,:,hei_index]) |
|
1025 | zdB = 10*numpy.log10(z[0,:,hei_index]) | |
1026 | xlabel = "Frequency (kHz)" |
|
1026 | xlabel = "Frequency (kHz)" | |
1027 | ylabel = "Power (dB)" |
|
1027 | ylabel = "Power (dB)" | |
1028 |
|
1028 | |||
1029 | elif xaxis == "time": |
|
1029 | elif xaxis == "time": | |
1030 | x = dataOut.getAcfRange() |
|
1030 | x = dataOut.getAcfRange() | |
1031 | zdB = z[0,:,hei_index] |
|
1031 | zdB = z[0,:,hei_index] | |
1032 | xlabel = "Time (ms)" |
|
1032 | xlabel = "Time (ms)" | |
1033 | ylabel = "ACF" |
|
1033 | ylabel = "ACF" | |
1034 |
|
1034 | |||
1035 | else: |
|
1035 | else: | |
1036 | x = dataOut.getVelRange() |
|
1036 | x = dataOut.getVelRange() | |
1037 | zdB = 10*numpy.log10(z[0,:,hei_index]) |
|
1037 | zdB = 10*numpy.log10(z[0,:,hei_index]) | |
1038 | xlabel = "Velocity (m/s)" |
|
1038 | xlabel = "Velocity (m/s)" | |
1039 | ylabel = "Power (dB)" |
|
1039 | ylabel = "Power (dB)" | |
1040 |
|
1040 | |||
1041 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) |
|
1041 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) | |
1042 | title = wintitle + " Range Cuts %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
1042 | title = wintitle + " Range Cuts %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
1043 |
|
1043 | |||
1044 | if not self.isConfig: |
|
1044 | if not self.isConfig: | |
1045 |
|
1045 | |||
1046 | nplots = 1 |
|
1046 | nplots = 1 | |
1047 |
|
1047 | |||
1048 | self.setup(id=id, |
|
1048 | self.setup(id=id, | |
1049 | nplots=nplots, |
|
1049 | nplots=nplots, | |
1050 | wintitle=wintitle, |
|
1050 | wintitle=wintitle, | |
1051 | show=show) |
|
1051 | show=show) | |
1052 |
|
1052 | |||
1053 | if xmin == None: xmin = numpy.nanmin(x)*0.9 |
|
1053 | if xmin == None: xmin = numpy.nanmin(x)*0.9 | |
1054 | if xmax == None: xmax = numpy.nanmax(x)*1.1 |
|
1054 | if xmax == None: xmax = numpy.nanmax(x)*1.1 | |
1055 | if ymin == None: ymin = numpy.nanmin(zdB) |
|
1055 | if ymin == None: ymin = numpy.nanmin(zdB) | |
1056 | if ymax == None: ymax = numpy.nanmax(zdB) |
|
1056 | if ymax == None: ymax = numpy.nanmax(zdB) | |
1057 |
|
1057 | |||
1058 | self.isConfig = True |
|
1058 | self.isConfig = True | |
1059 |
|
1059 | |||
1060 | self.setWinTitle(title) |
|
1060 | self.setWinTitle(title) | |
1061 |
|
1061 | |||
1062 | title = "Spectra Cuts: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
1062 | title = "Spectra Cuts: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
1063 | axes = self.axesList[0] |
|
1063 | axes = self.axesList[0] | |
1064 |
|
1064 | |||
1065 | legendlabels = ["Range = %dKm" %y[i] for i in hei_index] |
|
1065 | legendlabels = ["Range = %dKm" %y[i] for i in hei_index] | |
1066 |
|
1066 | |||
1067 | axes.pmultilineyaxis( x, zdB, |
|
1067 | axes.pmultilineyaxis( x, zdB, | |
1068 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, |
|
1068 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, | |
1069 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, |
|
1069 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, | |
1070 | ytick_visible=True, nxticks=5, |
|
1070 | ytick_visible=True, nxticks=5, | |
1071 | grid='x') |
|
1071 | grid='x') | |
1072 |
|
1072 | |||
1073 | self.draw() |
|
1073 | self.draw() | |
1074 |
|
1074 | |||
1075 | self.save(figpath=figpath, |
|
1075 | self.save(figpath=figpath, | |
1076 | figfile=figfile, |
|
1076 | figfile=figfile, | |
1077 | save=save, |
|
1077 | save=save, | |
1078 | ftp=ftp, |
|
1078 | ftp=ftp, | |
1079 | wr_period=wr_period, |
|
1079 | wr_period=wr_period, | |
1080 | thisDatetime=thisDatetime) |
|
1080 | thisDatetime=thisDatetime) | |
1081 |
|
1081 | |||
1082 | class Noise(Figure): |
|
1082 | class Noise(Figure): | |
1083 |
|
1083 | |||
1084 | isConfig = None |
|
1084 | isConfig = None | |
1085 | __nsubplots = None |
|
1085 | __nsubplots = None | |
1086 |
|
1086 | |||
1087 | PREFIX = 'noise' |
|
1087 | PREFIX = 'noise' | |
1088 |
|
1088 | |||
1089 | def __init__(self): |
|
1089 | def __init__(self): | |
1090 |
|
1090 | |||
1091 | self.timerange = 24*60*60 |
|
1091 | self.timerange = 24*60*60 | |
1092 | self.isConfig = False |
|
1092 | self.isConfig = False | |
1093 | self.__nsubplots = 1 |
|
1093 | self.__nsubplots = 1 | |
1094 | self.counter_imagwr = 0 |
|
1094 | self.counter_imagwr = 0 | |
1095 | self.WIDTH = 800 |
|
1095 | self.WIDTH = 800 | |
1096 | self.HEIGHT = 400 |
|
1096 | self.HEIGHT = 400 | |
1097 | self.WIDTHPROF = 120 |
|
1097 | self.WIDTHPROF = 120 | |
1098 | self.HEIGHTPROF = 0 |
|
1098 | self.HEIGHTPROF = 0 | |
1099 | self.xdata = None |
|
1099 | self.xdata = None | |
1100 | self.ydata = None |
|
1100 | self.ydata = None | |
1101 |
|
1101 | |||
1102 | self.PLOT_CODE = NOISE_CODE |
|
1102 | self.PLOT_CODE = NOISE_CODE | |
1103 |
|
1103 | |||
1104 | self.FTP_WEI = None |
|
1104 | self.FTP_WEI = None | |
1105 | self.EXP_CODE = None |
|
1105 | self.EXP_CODE = None | |
1106 | self.SUB_EXP_CODE = None |
|
1106 | self.SUB_EXP_CODE = None | |
1107 | self.PLOT_POS = None |
|
1107 | self.PLOT_POS = None | |
1108 | self.figfile = None |
|
1108 | self.figfile = None | |
1109 |
|
1109 | |||
1110 | self.xmin = None |
|
1110 | self.xmin = None | |
1111 | self.xmax = None |
|
1111 | self.xmax = None | |
1112 |
|
1112 | |||
1113 | def getSubplots(self): |
|
1113 | def getSubplots(self): | |
1114 |
|
1114 | |||
1115 | ncol = 1 |
|
1115 | ncol = 1 | |
1116 | nrow = 1 |
|
1116 | nrow = 1 | |
1117 |
|
1117 | |||
1118 | return nrow, ncol |
|
1118 | return nrow, ncol | |
1119 |
|
1119 | |||
1120 | def openfile(self, filename): |
|
1120 | def openfile(self, filename): | |
1121 | dirname = os.path.dirname(filename) |
|
1121 | dirname = os.path.dirname(filename) | |
1122 |
|
1122 | |||
1123 | if not os.path.exists(dirname): |
|
1123 | if not os.path.exists(dirname): | |
1124 | os.mkdir(dirname) |
|
1124 | os.mkdir(dirname) | |
1125 |
|
1125 | |||
1126 | f = open(filename,'w+') |
|
1126 | f = open(filename,'w+') | |
1127 | f.write('\n\n') |
|
1127 | f.write('\n\n') | |
1128 | f.write('JICAMARCA RADIO OBSERVATORY - Noise \n') |
|
1128 | f.write('JICAMARCA RADIO OBSERVATORY - Noise \n') | |
1129 | f.write('DD MM YYYY HH MM SS Channel0 Channel1 Channel2 Channel3\n\n' ) |
|
1129 | f.write('DD MM YYYY HH MM SS Channel0 Channel1 Channel2 Channel3\n\n' ) | |
1130 | f.close() |
|
1130 | f.close() | |
1131 |
|
1131 | |||
1132 | def save_data(self, filename_phase, data, data_datetime): |
|
1132 | def save_data(self, filename_phase, data, data_datetime): | |
1133 |
|
1133 | |||
1134 | f=open(filename_phase,'a') |
|
1134 | f=open(filename_phase,'a') | |
1135 |
|
1135 | |||
1136 | timetuple_data = data_datetime.timetuple() |
|
1136 | timetuple_data = data_datetime.timetuple() | |
1137 | day = str(timetuple_data.tm_mday) |
|
1137 | day = str(timetuple_data.tm_mday) | |
1138 | month = str(timetuple_data.tm_mon) |
|
1138 | month = str(timetuple_data.tm_mon) | |
1139 | year = str(timetuple_data.tm_year) |
|
1139 | year = str(timetuple_data.tm_year) | |
1140 | hour = str(timetuple_data.tm_hour) |
|
1140 | hour = str(timetuple_data.tm_hour) | |
1141 | minute = str(timetuple_data.tm_min) |
|
1141 | minute = str(timetuple_data.tm_min) | |
1142 | second = str(timetuple_data.tm_sec) |
|
1142 | second = str(timetuple_data.tm_sec) | |
1143 |
|
1143 | |||
1144 | data_msg = '' |
|
1144 | data_msg = '' | |
1145 | for i in range(len(data)): |
|
1145 | for i in range(len(data)): | |
1146 | data_msg += str(data[i]) + ' ' |
|
1146 | data_msg += str(data[i]) + ' ' | |
1147 |
|
1147 | |||
1148 | f.write(day+' '+month+' '+year+' '+hour+' '+minute+' '+second+' ' + data_msg + '\n') |
|
1148 | f.write(day+' '+month+' '+year+' '+hour+' '+minute+' '+second+' ' + data_msg + '\n') | |
1149 | f.close() |
|
1149 | f.close() | |
1150 |
|
1150 | |||
1151 |
|
1151 | |||
1152 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
1152 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
1153 |
|
1153 | |||
1154 | self.__showprofile = showprofile |
|
1154 | self.__showprofile = showprofile | |
1155 | self.nplots = nplots |
|
1155 | self.nplots = nplots | |
1156 |
|
1156 | |||
1157 | ncolspan = 7 |
|
1157 | ncolspan = 7 | |
1158 | colspan = 6 |
|
1158 | colspan = 6 | |
1159 | self.__nsubplots = 2 |
|
1159 | self.__nsubplots = 2 | |
1160 |
|
1160 | |||
1161 | self.createFigure(id = id, |
|
1161 | self.createFigure(id = id, | |
1162 | wintitle = wintitle, |
|
1162 | wintitle = wintitle, | |
1163 | widthplot = self.WIDTH+self.WIDTHPROF, |
|
1163 | widthplot = self.WIDTH+self.WIDTHPROF, | |
1164 | heightplot = self.HEIGHT+self.HEIGHTPROF, |
|
1164 | heightplot = self.HEIGHT+self.HEIGHTPROF, | |
1165 | show=show) |
|
1165 | show=show) | |
1166 |
|
1166 | |||
1167 | nrow, ncol = self.getSubplots() |
|
1167 | nrow, ncol = self.getSubplots() | |
1168 |
|
1168 | |||
1169 | self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1) |
|
1169 | self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1) | |
1170 |
|
1170 | |||
1171 |
|
1171 | |||
1172 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True', |
|
1172 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True', | |
1173 | xmin=None, xmax=None, ymin=None, ymax=None, |
|
1173 | xmin=None, xmax=None, ymin=None, ymax=None, | |
1174 | timerange=None, |
|
1174 | timerange=None, | |
1175 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, |
|
1175 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, | |
1176 | server=None, folder=None, username=None, password=None, |
|
1176 | server=None, folder=None, username=None, password=None, | |
1177 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
1177 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
1178 |
|
1178 | |||
1179 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): |
|
1179 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): | |
1180 | return |
|
1180 | return | |
1181 |
|
1181 | |||
1182 | if channelList == None: |
|
1182 | if channelList == None: | |
1183 | channelIndexList = dataOut.channelIndexList |
|
1183 | channelIndexList = dataOut.channelIndexList | |
1184 | channelList = dataOut.channelList |
|
1184 | channelList = dataOut.channelList | |
1185 | else: |
|
1185 | else: | |
1186 | channelIndexList = [] |
|
1186 | channelIndexList = [] | |
1187 | for channel in channelList: |
|
1187 | for channel in channelList: | |
1188 | if channel not in dataOut.channelList: |
|
1188 | if channel not in dataOut.channelList: | |
1189 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
1189 | raise ValueError, "Channel %d is not in dataOut.channelList" | |
1190 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
1190 | channelIndexList.append(dataOut.channelList.index(channel)) | |
1191 |
|
1191 | |||
1192 | x = dataOut.getTimeRange() |
|
1192 | x = dataOut.getTimeRange() | |
1193 | #y = dataOut.getHeiRange() |
|
1193 | #y = dataOut.getHeiRange() | |
1194 | factor = dataOut.normFactor |
|
1194 | factor = dataOut.normFactor | |
1195 | noise = dataOut.noise[channelIndexList]/factor |
|
1195 | noise = dataOut.noise[channelIndexList]/factor | |
1196 | noisedB = 10*numpy.log10(noise) |
|
1196 | noisedB = 10*numpy.log10(noise) | |
1197 |
|
1197 | |||
1198 | thisDatetime = dataOut.datatime |
|
1198 | thisDatetime = dataOut.datatime | |
1199 |
|
1199 | |||
1200 | title = wintitle + " Noise" # : %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
1200 | title = wintitle + " Noise" # : %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
1201 | xlabel = "" |
|
1201 | xlabel = "" | |
1202 | ylabel = "Intensity (dB)" |
|
1202 | ylabel = "Intensity (dB)" | |
1203 | update_figfile = False |
|
1203 | update_figfile = False | |
1204 |
|
1204 | |||
1205 | if not self.isConfig: |
|
1205 | if not self.isConfig: | |
1206 |
|
1206 | |||
1207 | nplots = 1 |
|
1207 | nplots = 1 | |
1208 |
|
1208 | |||
1209 | self.setup(id=id, |
|
1209 | self.setup(id=id, | |
1210 | nplots=nplots, |
|
1210 | nplots=nplots, | |
1211 | wintitle=wintitle, |
|
1211 | wintitle=wintitle, | |
1212 | showprofile=showprofile, |
|
1212 | showprofile=showprofile, | |
1213 | show=show) |
|
1213 | show=show) | |
1214 |
|
1214 | |||
1215 | if timerange != None: |
|
1215 | if timerange != None: | |
1216 | self.timerange = timerange |
|
1216 | self.timerange = timerange | |
1217 |
|
1217 | |||
1218 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
1218 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
1219 |
|
1219 | |||
1220 | if ymin == None: ymin = numpy.floor(numpy.nanmin(noisedB)) - 10.0 |
|
1220 | if ymin == None: ymin = numpy.floor(numpy.nanmin(noisedB)) - 10.0 | |
1221 | if ymax == None: ymax = numpy.nanmax(noisedB) + 10.0 |
|
1221 | if ymax == None: ymax = numpy.nanmax(noisedB) + 10.0 | |
1222 |
|
1222 | |||
1223 | self.FTP_WEI = ftp_wei |
|
1223 | self.FTP_WEI = ftp_wei | |
1224 | self.EXP_CODE = exp_code |
|
1224 | self.EXP_CODE = exp_code | |
1225 | self.SUB_EXP_CODE = sub_exp_code |
|
1225 | self.SUB_EXP_CODE = sub_exp_code | |
1226 | self.PLOT_POS = plot_pos |
|
1226 | self.PLOT_POS = plot_pos | |
1227 |
|
1227 | |||
1228 |
|
1228 | |||
1229 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
1229 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
1230 | self.isConfig = True |
|
1230 | self.isConfig = True | |
1231 | self.figfile = figfile |
|
1231 | self.figfile = figfile | |
1232 | self.xdata = numpy.array([]) |
|
1232 | self.xdata = numpy.array([]) | |
1233 | self.ydata = numpy.array([]) |
|
1233 | self.ydata = numpy.array([]) | |
1234 |
|
1234 | |||
1235 | update_figfile = True |
|
1235 | update_figfile = True | |
1236 |
|
1236 | |||
1237 | #open file beacon phase |
|
1237 | #open file beacon phase | |
1238 | path = '%s%03d' %(self.PREFIX, self.id) |
|
1238 | path = '%s%03d' %(self.PREFIX, self.id) | |
1239 | noise_file = os.path.join(path,'%s.txt'%self.name) |
|
1239 | noise_file = os.path.join(path,'%s.txt'%self.name) | |
1240 | self.filename_noise = os.path.join(figpath,noise_file) |
|
1240 | self.filename_noise = os.path.join(figpath,noise_file) | |
1241 |
|
1241 | |||
1242 | self.setWinTitle(title) |
|
1242 | self.setWinTitle(title) | |
1243 |
|
1243 | |||
1244 | title = "Noise %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
1244 | title = "Noise %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
1245 |
|
1245 | |||
1246 | legendlabels = ["channel %d"%(idchannel) for idchannel in channelList] |
|
1246 | legendlabels = ["channel %d"%(idchannel) for idchannel in channelList] | |
1247 | axes = self.axesList[0] |
|
1247 | axes = self.axesList[0] | |
1248 |
|
1248 | |||
1249 | self.xdata = numpy.hstack((self.xdata, x[0:1])) |
|
1249 | self.xdata = numpy.hstack((self.xdata, x[0:1])) | |
1250 |
|
1250 | |||
1251 | if len(self.ydata)==0: |
|
1251 | if len(self.ydata)==0: | |
1252 | self.ydata = noisedB.reshape(-1,1) |
|
1252 | self.ydata = noisedB.reshape(-1,1) | |
1253 | else: |
|
1253 | else: | |
1254 | self.ydata = numpy.hstack((self.ydata, noisedB.reshape(-1,1))) |
|
1254 | self.ydata = numpy.hstack((self.ydata, noisedB.reshape(-1,1))) | |
1255 |
|
1255 | |||
1256 |
|
1256 | |||
1257 | axes.pmultilineyaxis(x=self.xdata, y=self.ydata, |
|
1257 | axes.pmultilineyaxis(x=self.xdata, y=self.ydata, | |
1258 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, |
|
1258 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, | |
1259 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid", |
|
1259 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid", | |
1260 | XAxisAsTime=True, grid='both' |
|
1260 | XAxisAsTime=True, grid='both' | |
1261 | ) |
|
1261 | ) | |
1262 |
|
1262 | |||
1263 | self.draw() |
|
1263 | self.draw() | |
1264 |
|
1264 | |||
1265 | if dataOut.ltctime >= self.xmax: |
|
1265 | if dataOut.ltctime >= self.xmax: | |
1266 | self.counter_imagwr = wr_period |
|
1266 | self.counter_imagwr = wr_period | |
1267 | self.isConfig = False |
|
1267 | self.isConfig = False | |
1268 | update_figfile = True |
|
1268 | update_figfile = True | |
1269 |
|
1269 | |||
1270 | self.save(figpath=figpath, |
|
1270 | self.save(figpath=figpath, | |
1271 | figfile=figfile, |
|
1271 | figfile=figfile, | |
1272 | save=save, |
|
1272 | save=save, | |
1273 | ftp=ftp, |
|
1273 | ftp=ftp, | |
1274 | wr_period=wr_period, |
|
1274 | wr_period=wr_period, | |
1275 | thisDatetime=thisDatetime, |
|
1275 | thisDatetime=thisDatetime, | |
1276 | update_figfile=update_figfile) |
|
1276 | update_figfile=update_figfile) | |
1277 |
|
1277 | |||
1278 | #store data beacon phase |
|
1278 | #store data beacon phase | |
1279 | if save: |
|
1279 | if save: | |
1280 | self.save_data(self.filename_noise, noisedB, thisDatetime) |
|
1280 | self.save_data(self.filename_noise, noisedB, thisDatetime) | |
1281 |
|
1281 | |||
1282 | class BeaconPhase(Figure): |
|
1282 | class BeaconPhase(Figure): | |
1283 |
|
1283 | |||
1284 | __isConfig = None |
|
1284 | __isConfig = None | |
1285 | __nsubplots = None |
|
1285 | __nsubplots = None | |
1286 |
|
1286 | |||
1287 | PREFIX = 'beacon_phase' |
|
1287 | PREFIX = 'beacon_phase' | |
1288 |
|
1288 | |||
1289 | def __init__(self): |
|
1289 | def __init__(self): | |
1290 |
|
1290 | |||
1291 | self.timerange = 24*60*60 |
|
1291 | self.timerange = 24*60*60 | |
1292 | self.isConfig = False |
|
1292 | self.isConfig = False | |
1293 | self.__nsubplots = 1 |
|
1293 | self.__nsubplots = 1 | |
1294 | self.counter_imagwr = 0 |
|
1294 | self.counter_imagwr = 0 | |
1295 | self.WIDTH = 800 |
|
1295 | self.WIDTH = 800 | |
1296 | self.HEIGHT = 400 |
|
1296 | self.HEIGHT = 400 | |
1297 | self.WIDTHPROF = 120 |
|
1297 | self.WIDTHPROF = 120 | |
1298 | self.HEIGHTPROF = 0 |
|
1298 | self.HEIGHTPROF = 0 | |
1299 | self.xdata = None |
|
1299 | self.xdata = None | |
1300 | self.ydata = None |
|
1300 | self.ydata = None | |
1301 |
|
1301 | |||
1302 | self.PLOT_CODE = BEACON_CODE |
|
1302 | self.PLOT_CODE = BEACON_CODE | |
1303 |
|
1303 | |||
1304 | self.FTP_WEI = None |
|
1304 | self.FTP_WEI = None | |
1305 | self.EXP_CODE = None |
|
1305 | self.EXP_CODE = None | |
1306 | self.SUB_EXP_CODE = None |
|
1306 | self.SUB_EXP_CODE = None | |
1307 | self.PLOT_POS = None |
|
1307 | self.PLOT_POS = None | |
1308 |
|
1308 | |||
1309 | self.filename_phase = None |
|
1309 | self.filename_phase = None | |
1310 |
|
1310 | |||
1311 | self.figfile = None |
|
1311 | self.figfile = None | |
1312 |
|
1312 | |||
1313 | self.xmin = None |
|
1313 | self.xmin = None | |
1314 | self.xmax = None |
|
1314 | self.xmax = None | |
1315 |
|
1315 | |||
1316 | def getSubplots(self): |
|
1316 | def getSubplots(self): | |
1317 |
|
1317 | |||
1318 | ncol = 1 |
|
1318 | ncol = 1 | |
1319 | nrow = 1 |
|
1319 | nrow = 1 | |
1320 |
|
1320 | |||
1321 | return nrow, ncol |
|
1321 | return nrow, ncol | |
1322 |
|
1322 | |||
1323 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): |
|
1323 | def setup(self, id, nplots, wintitle, showprofile=True, show=True): | |
1324 |
|
1324 | |||
1325 | self.__showprofile = showprofile |
|
1325 | self.__showprofile = showprofile | |
1326 | self.nplots = nplots |
|
1326 | self.nplots = nplots | |
1327 |
|
1327 | |||
1328 | ncolspan = 7 |
|
1328 | ncolspan = 7 | |
1329 | colspan = 6 |
|
1329 | colspan = 6 | |
1330 | self.__nsubplots = 2 |
|
1330 | self.__nsubplots = 2 | |
1331 |
|
1331 | |||
1332 | self.createFigure(id = id, |
|
1332 | self.createFigure(id = id, | |
1333 | wintitle = wintitle, |
|
1333 | wintitle = wintitle, | |
1334 | widthplot = self.WIDTH+self.WIDTHPROF, |
|
1334 | widthplot = self.WIDTH+self.WIDTHPROF, | |
1335 | heightplot = self.HEIGHT+self.HEIGHTPROF, |
|
1335 | heightplot = self.HEIGHT+self.HEIGHTPROF, | |
1336 | show=show) |
|
1336 | show=show) | |
1337 |
|
1337 | |||
1338 | nrow, ncol = self.getSubplots() |
|
1338 | nrow, ncol = self.getSubplots() | |
1339 |
|
1339 | |||
1340 | self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1) |
|
1340 | self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1) | |
1341 |
|
1341 | |||
1342 | def save_phase(self, filename_phase): |
|
1342 | def save_phase(self, filename_phase): | |
1343 | f = open(filename_phase,'w+') |
|
1343 | f = open(filename_phase,'w+') | |
1344 | f.write('\n\n') |
|
1344 | f.write('\n\n') | |
1345 | f.write('JICAMARCA RADIO OBSERVATORY - Beacon Phase \n') |
|
1345 | f.write('JICAMARCA RADIO OBSERVATORY - Beacon Phase \n') | |
1346 | f.write('DD MM YYYY HH MM SS pair(2,0) pair(2,1) pair(2,3) pair(2,4)\n\n' ) |
|
1346 | f.write('DD MM YYYY HH MM SS pair(2,0) pair(2,1) pair(2,3) pair(2,4)\n\n' ) | |
1347 | f.close() |
|
1347 | f.close() | |
1348 |
|
1348 | |||
1349 | def save_data(self, filename_phase, data, data_datetime): |
|
1349 | def save_data(self, filename_phase, data, data_datetime): | |
1350 | f=open(filename_phase,'a') |
|
1350 | f=open(filename_phase,'a') | |
1351 | timetuple_data = data_datetime.timetuple() |
|
1351 | timetuple_data = data_datetime.timetuple() | |
1352 | day = str(timetuple_data.tm_mday) |
|
1352 | day = str(timetuple_data.tm_mday) | |
1353 | month = str(timetuple_data.tm_mon) |
|
1353 | month = str(timetuple_data.tm_mon) | |
1354 | year = str(timetuple_data.tm_year) |
|
1354 | year = str(timetuple_data.tm_year) | |
1355 | hour = str(timetuple_data.tm_hour) |
|
1355 | hour = str(timetuple_data.tm_hour) | |
1356 | minute = str(timetuple_data.tm_min) |
|
1356 | minute = str(timetuple_data.tm_min) | |
1357 | second = str(timetuple_data.tm_sec) |
|
1357 | second = str(timetuple_data.tm_sec) | |
1358 | f.write(day+' '+month+' '+year+' '+hour+' '+minute+' '+second+' '+str(data[0])+' '+str(data[1])+' '+str(data[2])+' '+str(data[3])+'\n') |
|
1358 | f.write(day+' '+month+' '+year+' '+hour+' '+minute+' '+second+' '+str(data[0])+' '+str(data[1])+' '+str(data[2])+' '+str(data[3])+'\n') | |
1359 | f.close() |
|
1359 | f.close() | |
1360 |
|
1360 | |||
1361 |
|
1361 | |||
1362 | def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True', |
|
1362 | def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True', | |
1363 | xmin=None, xmax=None, ymin=None, ymax=None, hmin=None, hmax=None, |
|
1363 | xmin=None, xmax=None, ymin=None, ymax=None, hmin=None, hmax=None, | |
1364 | timerange=None, |
|
1364 | timerange=None, | |
1365 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, |
|
1365 | save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1, | |
1366 | server=None, folder=None, username=None, password=None, |
|
1366 | server=None, folder=None, username=None, password=None, | |
1367 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
1367 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): | |
1368 |
|
1368 | |||
1369 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): |
|
1369 | if not isTimeInHourRange(dataOut.datatime, xmin, xmax): | |
1370 | return |
|
1370 | return | |
1371 |
|
1371 | |||
1372 | if pairsList == None: |
|
1372 | if pairsList == None: | |
1373 | pairsIndexList = dataOut.pairsIndexList[:10] |
|
1373 | pairsIndexList = dataOut.pairsIndexList[:10] | |
1374 | else: |
|
1374 | else: | |
1375 | pairsIndexList = [] |
|
1375 | pairsIndexList = [] | |
1376 | for pair in pairsList: |
|
1376 | for pair in pairsList: | |
1377 | if pair not in dataOut.pairsList: |
|
1377 | if pair not in dataOut.pairsList: | |
1378 | raise ValueError, "Pair %s is not in dataOut.pairsList" %(pair) |
|
1378 | raise ValueError, "Pair %s is not in dataOut.pairsList" %(pair) | |
1379 | pairsIndexList.append(dataOut.pairsList.index(pair)) |
|
1379 | pairsIndexList.append(dataOut.pairsList.index(pair)) | |
1380 |
|
1380 | |||
1381 | if pairsIndexList == []: |
|
1381 | if pairsIndexList == []: | |
1382 | return |
|
1382 | return | |
1383 |
|
1383 | |||
1384 | # if len(pairsIndexList) > 4: |
|
1384 | # if len(pairsIndexList) > 4: | |
1385 | # pairsIndexList = pairsIndexList[0:4] |
|
1385 | # pairsIndexList = pairsIndexList[0:4] | |
1386 |
|
1386 | |||
1387 | hmin_index = None |
|
1387 | hmin_index = None | |
1388 | hmax_index = None |
|
1388 | hmax_index = None | |
1389 |
|
1389 | |||
1390 | if hmin != None and hmax != None: |
|
1390 | if hmin != None and hmax != None: | |
1391 | indexes = numpy.arange(dataOut.nHeights) |
|
1391 | indexes = numpy.arange(dataOut.nHeights) | |
1392 | hmin_list = indexes[dataOut.heightList >= hmin] |
|
1392 | hmin_list = indexes[dataOut.heightList >= hmin] | |
1393 | hmax_list = indexes[dataOut.heightList <= hmax] |
|
1393 | hmax_list = indexes[dataOut.heightList <= hmax] | |
1394 |
|
1394 | |||
1395 | if hmin_list.any(): |
|
1395 | if hmin_list.any(): | |
1396 | hmin_index = hmin_list[0] |
|
1396 | hmin_index = hmin_list[0] | |
1397 |
|
1397 | |||
1398 | if hmax_list.any(): |
|
1398 | if hmax_list.any(): | |
1399 | hmax_index = hmax_list[-1]+1 |
|
1399 | hmax_index = hmax_list[-1]+1 | |
1400 |
|
1400 | |||
1401 | x = dataOut.getTimeRange() |
|
1401 | x = dataOut.getTimeRange() | |
1402 | #y = dataOut.getHeiRange() |
|
1402 | #y = dataOut.getHeiRange() | |
1403 |
|
1403 | |||
1404 |
|
1404 | |||
1405 | thisDatetime = dataOut.datatime |
|
1405 | thisDatetime = dataOut.datatime | |
1406 |
|
1406 | |||
1407 | title = wintitle + " Signal Phase" # : %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
1407 | title = wintitle + " Signal Phase" # : %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
1408 | xlabel = "Local Time" |
|
1408 | xlabel = "Local Time" | |
1409 | ylabel = "Phase (degrees)" |
|
1409 | ylabel = "Phase (degrees)" | |
1410 |
|
1410 | |||
1411 | update_figfile = False |
|
1411 | update_figfile = False | |
1412 |
|
1412 | |||
1413 | nplots = len(pairsIndexList) |
|
1413 | nplots = len(pairsIndexList) | |
1414 | #phase = numpy.zeros((len(pairsIndexList),len(dataOut.beacon_heiIndexList))) |
|
1414 | #phase = numpy.zeros((len(pairsIndexList),len(dataOut.beacon_heiIndexList))) | |
1415 | phase_beacon = numpy.zeros(len(pairsIndexList)) |
|
1415 | phase_beacon = numpy.zeros(len(pairsIndexList)) | |
1416 | for i in range(nplots): |
|
1416 | for i in range(nplots): | |
1417 | pair = dataOut.pairsList[pairsIndexList[i]] |
|
1417 | pair = dataOut.pairsList[pairsIndexList[i]] | |
1418 | ccf = numpy.average(dataOut.data_cspc[pairsIndexList[i], :, hmin_index:hmax_index], axis=0) |
|
1418 | ccf = numpy.average(dataOut.data_cspc[pairsIndexList[i], :, hmin_index:hmax_index], axis=0) | |
1419 | powa = numpy.average(dataOut.data_spc[pair[0], :, hmin_index:hmax_index], axis=0) |
|
1419 | powa = numpy.average(dataOut.data_spc[pair[0], :, hmin_index:hmax_index], axis=0) | |
1420 | powb = numpy.average(dataOut.data_spc[pair[1], :, hmin_index:hmax_index], axis=0) |
|
1420 | powb = numpy.average(dataOut.data_spc[pair[1], :, hmin_index:hmax_index], axis=0) | |
1421 | avgcoherenceComplex = ccf/numpy.sqrt(powa*powb) |
|
1421 | avgcoherenceComplex = ccf/numpy.sqrt(powa*powb) | |
1422 | phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi |
|
1422 | phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi | |
1423 |
|
1423 | |||
1424 | #print "Phase %d%d" %(pair[0], pair[1]) |
|
1424 | #print "Phase %d%d" %(pair[0], pair[1]) | |
1425 | #print phase[dataOut.beacon_heiIndexList] |
|
1425 | #print phase[dataOut.beacon_heiIndexList] | |
1426 |
|
1426 | |||
1427 | if dataOut.beacon_heiIndexList: |
|
1427 | if dataOut.beacon_heiIndexList: | |
1428 | phase_beacon[i] = numpy.average(phase[dataOut.beacon_heiIndexList]) |
|
1428 | phase_beacon[i] = numpy.average(phase[dataOut.beacon_heiIndexList]) | |
1429 | else: |
|
1429 | else: | |
1430 | phase_beacon[i] = numpy.average(phase) |
|
1430 | phase_beacon[i] = numpy.average(phase) | |
1431 |
|
1431 | |||
1432 | if not self.isConfig: |
|
1432 | if not self.isConfig: | |
1433 |
|
1433 | |||
1434 | nplots = len(pairsIndexList) |
|
1434 | nplots = len(pairsIndexList) | |
1435 |
|
1435 | |||
1436 | self.setup(id=id, |
|
1436 | self.setup(id=id, | |
1437 | nplots=nplots, |
|
1437 | nplots=nplots, | |
1438 | wintitle=wintitle, |
|
1438 | wintitle=wintitle, | |
1439 | showprofile=showprofile, |
|
1439 | showprofile=showprofile, | |
1440 | show=show) |
|
1440 | show=show) | |
1441 |
|
1441 | |||
1442 | if timerange != None: |
|
1442 | if timerange != None: | |
1443 | self.timerange = timerange |
|
1443 | self.timerange = timerange | |
1444 |
|
1444 | |||
1445 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) |
|
1445 | self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange) | |
1446 |
|
1446 | |||
1447 | if ymin == None: ymin = 0 |
|
1447 | if ymin == None: ymin = 0 | |
1448 | if ymax == None: ymax = 360 |
|
1448 | if ymax == None: ymax = 360 | |
1449 |
|
1449 | |||
1450 | self.FTP_WEI = ftp_wei |
|
1450 | self.FTP_WEI = ftp_wei | |
1451 | self.EXP_CODE = exp_code |
|
1451 | self.EXP_CODE = exp_code | |
1452 | self.SUB_EXP_CODE = sub_exp_code |
|
1452 | self.SUB_EXP_CODE = sub_exp_code | |
1453 | self.PLOT_POS = plot_pos |
|
1453 | self.PLOT_POS = plot_pos | |
1454 |
|
1454 | |||
1455 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
1455 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
1456 | self.isConfig = True |
|
1456 | self.isConfig = True | |
1457 | self.figfile = figfile |
|
1457 | self.figfile = figfile | |
1458 | self.xdata = numpy.array([]) |
|
1458 | self.xdata = numpy.array([]) | |
1459 | self.ydata = numpy.array([]) |
|
1459 | self.ydata = numpy.array([]) | |
1460 |
|
1460 | |||
1461 | update_figfile = True |
|
1461 | update_figfile = True | |
1462 |
|
1462 | |||
1463 | #open file beacon phase |
|
1463 | #open file beacon phase | |
1464 | path = '%s%03d' %(self.PREFIX, self.id) |
|
1464 | path = '%s%03d' %(self.PREFIX, self.id) | |
1465 | beacon_file = os.path.join(path,'%s.txt'%self.name) |
|
1465 | beacon_file = os.path.join(path,'%s.txt'%self.name) | |
1466 | self.filename_phase = os.path.join(figpath,beacon_file) |
|
1466 | self.filename_phase = os.path.join(figpath,beacon_file) | |
1467 | #self.save_phase(self.filename_phase) |
|
1467 | #self.save_phase(self.filename_phase) | |
1468 |
|
1468 | |||
1469 |
|
1469 | |||
1470 | #store data beacon phase |
|
1470 | #store data beacon phase | |
1471 | #self.save_data(self.filename_phase, phase_beacon, thisDatetime) |
|
1471 | #self.save_data(self.filename_phase, phase_beacon, thisDatetime) | |
1472 |
|
1472 | |||
1473 | self.setWinTitle(title) |
|
1473 | self.setWinTitle(title) | |
1474 |
|
1474 | |||
1475 |
|
1475 | |||
1476 | title = "Phase Plot %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
1476 | title = "Phase Plot %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) | |
1477 |
|
1477 | |||
1478 | legendlabels = ["Pair (%d,%d)"%(pair[0], pair[1]) for pair in dataOut.pairsList] |
|
1478 | legendlabels = ["Pair (%d,%d)"%(pair[0], pair[1]) for pair in dataOut.pairsList] | |
1479 |
|
1479 | |||
1480 | axes = self.axesList[0] |
|
1480 | axes = self.axesList[0] | |
1481 |
|
1481 | |||
1482 | self.xdata = numpy.hstack((self.xdata, x[0:1])) |
|
1482 | self.xdata = numpy.hstack((self.xdata, x[0:1])) | |
1483 |
|
1483 | |||
1484 | if len(self.ydata)==0: |
|
1484 | if len(self.ydata)==0: | |
1485 | self.ydata = phase_beacon.reshape(-1,1) |
|
1485 | self.ydata = phase_beacon.reshape(-1,1) | |
1486 | else: |
|
1486 | else: | |
1487 | self.ydata = numpy.hstack((self.ydata, phase_beacon.reshape(-1,1))) |
|
1487 | self.ydata = numpy.hstack((self.ydata, phase_beacon.reshape(-1,1))) | |
1488 |
|
1488 | |||
1489 |
|
1489 | |||
1490 | axes.pmultilineyaxis(x=self.xdata, y=self.ydata, |
|
1490 | axes.pmultilineyaxis(x=self.xdata, y=self.ydata, | |
1491 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, |
|
1491 | xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, | |
1492 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid", |
|
1492 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid", | |
1493 | XAxisAsTime=True, grid='both' |
|
1493 | XAxisAsTime=True, grid='both' | |
1494 | ) |
|
1494 | ) | |
1495 |
|
1495 | |||
1496 | self.draw() |
|
1496 | self.draw() | |
1497 |
|
1497 | |||
1498 | if dataOut.ltctime >= self.xmax: |
|
1498 | if dataOut.ltctime >= self.xmax: | |
1499 | self.counter_imagwr = wr_period |
|
1499 | self.counter_imagwr = wr_period | |
1500 | self.isConfig = False |
|
1500 | self.isConfig = False | |
1501 | update_figfile = True |
|
1501 | update_figfile = True | |
1502 |
|
1502 | |||
1503 | self.save(figpath=figpath, |
|
1503 | self.save(figpath=figpath, | |
1504 | figfile=figfile, |
|
1504 | figfile=figfile, | |
1505 | save=save, |
|
1505 | save=save, | |
1506 | ftp=ftp, |
|
1506 | ftp=ftp, | |
1507 | wr_period=wr_period, |
|
1507 | wr_period=wr_period, | |
1508 | thisDatetime=thisDatetime, |
|
1508 | thisDatetime=thisDatetime, | |
1509 | update_figfile=update_figfile) |
|
1509 | update_figfile=update_figfile) |
General Comments 0
You need to be logged in to leave comments.
Login now