@@ -48,18 +48,13 class SpectraPlot(Plot): | |||||
48 |
|
48 | |||
49 | if self.CODE == 'spc_moments': |
|
49 | if self.CODE == 'spc_moments': | |
50 | data['moments'] = dataOut.moments |
|
50 | data['moments'] = dataOut.moments | |
51 | # data['spc'] = 10*numpy.log10(dataOut.data_pre[0]/dataOut.normFactor) |
|
|||
52 | if self.CODE == 'gaussian_fit': |
|
51 | if self.CODE == 'gaussian_fit': | |
53 | # data['moments'] = dataOut.moments |
|
|||
54 | data['gaussfit'] = dataOut.DGauFitParams |
|
52 | data['gaussfit'] = dataOut.DGauFitParams | |
55 | # data['spc'] = 10*numpy.log10(dataOut.data_pre[0]/dataOut.normFactor) |
|
|||
56 |
|
53 | |||
57 | return data, meta |
|
54 | return data, meta | |
58 |
|
55 | |||
59 | def plot(self): |
|
56 | def plot(self): | |
60 |
|
57 | |||
61 | #print(self.xaxis) |
|
|||
62 | #exit(1) |
|
|||
63 | if self.xaxis == "frequency": |
|
58 | if self.xaxis == "frequency": | |
64 | x = self.data.xrange[0] |
|
59 | x = self.data.xrange[0] | |
65 | self.xlabel = "Frequency (kHz)" |
|
60 | self.xlabel = "Frequency (kHz)" | |
@@ -90,7 +85,6 class SpectraPlot(Plot): | |||||
90 | if self.CODE == 'spc_moments': |
|
85 | if self.CODE == 'spc_moments': | |
91 | mean = data['moments'][n, 1] |
|
86 | mean = data['moments'][n, 1] | |
92 | if self.CODE == 'gaussian_fit': |
|
87 | if self.CODE == 'gaussian_fit': | |
93 | # mean = data['moments'][n, 1] |
|
|||
94 | gau0 = data['gaussfit'][n][2,:,0] |
|
88 | gau0 = data['gaussfit'][n][2,:,0] | |
95 | gau1 = data['gaussfit'][n][2,:,1] |
|
89 | gau1 = data['gaussfit'][n][2,:,1] | |
96 | if ax.firsttime: |
|
90 | if ax.firsttime: | |
@@ -98,7 +92,6 class SpectraPlot(Plot): | |||||
98 | self.xmin = self.xmin if self.xmin else -self.xmax |
|
92 | self.xmin = self.xmin if self.xmin else -self.xmax | |
99 | self.zmin = self.zmin if self.zmin else numpy.nanmin(z) |
|
93 | self.zmin = self.zmin if self.zmin else numpy.nanmin(z) | |
100 | self.zmax = self.zmax if self.zmax else numpy.nanmax(z) |
|
94 | self.zmax = self.zmax if self.zmax else numpy.nanmax(z) | |
101 | #print(numpy.shape(x)) |
|
|||
102 | ax.plt = ax.pcolormesh(x, y, z[n].T, |
|
95 | ax.plt = ax.pcolormesh(x, y, z[n].T, | |
103 | vmin=self.zmin, |
|
96 | vmin=self.zmin, | |
104 | vmax=self.zmax, |
|
97 | vmax=self.zmax, | |
@@ -132,7 +125,7 class SpectraObliquePlot(Plot): | |||||
132 | Plot for Spectra data |
|
125 | Plot for Spectra data | |
133 | ''' |
|
126 | ''' | |
134 |
|
127 | |||
135 | CODE = 'spc' |
|
128 | CODE = 'spc_oblique' | |
136 | colormap = 'jet' |
|
129 | colormap = 'jet' | |
137 | plot_type = 'pcolor' |
|
130 | plot_type = 'pcolor' | |
138 |
|
131 | |||
@@ -150,10 +143,25 class SpectraObliquePlot(Plot): | |||||
150 | self.plots_adjust.update({'wspace': 0.8, 'hspace':0.2, 'left': 0.2, 'right': 0.9, 'bottom': 0.18}) |
|
143 | self.plots_adjust.update({'wspace': 0.8, 'hspace':0.2, 'left': 0.2, 'right': 0.9, 'bottom': 0.18}) | |
151 | self.ylabel = 'Range [km]' |
|
144 | self.ylabel = 'Range [km]' | |
152 |
|
145 | |||
|
146 | def update(self, dataOut): | |||
|
147 | ||||
|
148 | data = {} | |||
|
149 | meta = {} | |||
|
150 | spc = 10*numpy.log10(dataOut.data_spc/dataOut.normFactor) | |||
|
151 | data['spc'] = spc | |||
|
152 | data['rti'] = dataOut.getPower() | |||
|
153 | data['noise'] = 10*numpy.log10(dataOut.getNoise()/dataOut.normFactor) | |||
|
154 | meta['xrange'] = (dataOut.getFreqRange(1)/1000., dataOut.getAcfRange(1), dataOut.getVelRange(1)) | |||
|
155 | ||||
|
156 | data['shift1'] = dataOut.Oblique_params[0][1] | |||
|
157 | data['shift2'] = dataOut.Oblique_params[0][4] | |||
|
158 | data['shift1_error'] = dataOut.Oblique_param_errors[0][1] | |||
|
159 | data['shift2_error'] = dataOut.Oblique_param_errors[0][4] | |||
|
160 | ||||
|
161 | return data, meta | |||
|
162 | ||||
153 | def plot(self): |
|
163 | def plot(self): | |
154 |
|
164 | |||
155 | #print(self.xaxis) |
|
|||
156 | #exit(1) |
|
|||
157 | if self.xaxis == "frequency": |
|
165 | if self.xaxis == "frequency": | |
158 | x = self.data.xrange[0] |
|
166 | x = self.data.xrange[0] | |
159 | self.xlabel = "Frequency (kHz)" |
|
167 | self.xlabel = "Frequency (kHz)" | |
@@ -164,35 +172,23 class SpectraObliquePlot(Plot): | |||||
164 | x = self.data.xrange[2] |
|
172 | x = self.data.xrange[2] | |
165 | self.xlabel = "Velocity (m/s)" |
|
173 | self.xlabel = "Velocity (m/s)" | |
166 |
|
174 | |||
167 | if self.CODE == 'spc_moments': |
|
|||
168 | x = self.data.xrange[2] |
|
|||
169 | self.xlabel = "Velocity (m/s)" |
|
|||
170 |
|
||||
171 | self.titles = [] |
|
175 | self.titles = [] | |
172 | #self.xlabel = "Velocidad (m/s)" |
|
|||
173 | #self.ylabel = 'Rango (km)' |
|
|||
174 |
|
||||
175 |
|
176 | |||
176 |
y = self.data. |
|
177 | y = self.data.yrange | |
177 | self.y = y |
|
178 | self.y = y | |
178 | z = self.data['spc'] |
|
179 | z = self.data['spc'] | |
179 |
|
180 | |||
180 | self.CODE2 = 'spc_oblique' |
|
|||
181 |
|
||||
182 |
|
||||
183 | for n, ax in enumerate(self.axes): |
|
181 | for n, ax in enumerate(self.axes): | |
184 | noise = self.data['noise'][n][-1] |
|
182 | noise = self.data['noise'][n][-1] | |
185 | if self.CODE == 'spc_moments': |
|
183 | shift1 = self.data['shift1'] | |
186 | mean = self.data['moments'][n, :, 1, :][-1] |
|
184 | shift2 = self.data['shift2'] | |
187 | if self.CODE2 == 'spc_oblique': |
|
185 | err1 = self.data['shift1_error'] | |
188 |
|
|
186 | err2 = self.data['shift2_error'] | |
189 | shift2 = self.data.shift2 |
|
|||
190 | if ax.firsttime: |
|
187 | if ax.firsttime: | |
191 | self.xmax = self.xmax if self.xmax else numpy.nanmax(x) |
|
188 | self.xmax = self.xmax if self.xmax else numpy.nanmax(x) | |
192 | self.xmin = self.xmin if self.xmin else -self.xmax |
|
189 | self.xmin = self.xmin if self.xmin else -self.xmax | |
193 | self.zmin = self.zmin if self.zmin else numpy.nanmin(z) |
|
190 | self.zmin = self.zmin if self.zmin else numpy.nanmin(z) | |
194 | self.zmax = self.zmax if self.zmax else numpy.nanmax(z) |
|
191 | self.zmax = self.zmax if self.zmax else numpy.nanmax(z) | |
195 | #print(numpy.shape(x)) |
|
|||
196 | ax.plt = ax.pcolormesh(x, y, z[n].T, |
|
192 | ax.plt = ax.pcolormesh(x, y, z[n].T, | |
197 | vmin=self.zmin, |
|
193 | vmin=self.zmin, | |
198 | vmax=self.zmax, |
|
194 | vmax=self.zmax, | |
@@ -204,15 +200,9 class SpectraObliquePlot(Plot): | |||||
204 | self.data['rti'][n][-1], y)[0] |
|
200 | self.data['rti'][n][-1], y)[0] | |
205 | ax.plt_noise = self.pf_axes[n].plot(numpy.repeat(noise, len(y)), y, |
|
201 | ax.plt_noise = self.pf_axes[n].plot(numpy.repeat(noise, len(y)), y, | |
206 | color="k", linestyle="dashed", lw=1)[0] |
|
202 | color="k", linestyle="dashed", lw=1)[0] | |
207 | if self.CODE == 'spc_moments': |
|
203 | ||
208 | ax.plt_mean = ax.plot(mean, y, color='k')[0] |
|
204 | self.ploterr1 = ax.errorbar(shift1, y, xerr=err1, fmt='k^', elinewidth=0.2, marker='x', linestyle='None',markersize=0.5,capsize=0.3,markeredgewidth=0.2) | |
209 |
|
205 | self.ploterr2 = ax.errorbar(shift2, y, xerr=err2, fmt='m^',elinewidth=0.2,marker='x',linestyle='None',markersize=0.5,capsize=0.3,markeredgewidth=0.2) | ||
210 | if self.CODE2 == 'spc_oblique': |
|
|||
211 | #ax.plt_shift1 = ax.plot(shift1, y, color='k', marker='x', linestyle='None', markersize=0.5)[0] |
|
|||
212 | #ax.plt_shift2 = ax.plot(shift2, y, color='m', marker='x', linestyle='None', markersize=0.5)[0] |
|
|||
213 | self.ploterr1 = ax.errorbar(shift1, y, xerr=self.data.shift1_error,fmt='k^',elinewidth=0.2,marker='x',linestyle='None',markersize=0.5,capsize=0.3,markeredgewidth=0.2) |
|
|||
214 | self.ploterr2 = ax.errorbar(shift2, y, xerr=self.data.shift2_error,fmt='m^',elinewidth=0.2,marker='x',linestyle='None',markersize=0.5,capsize=0.3,markeredgewidth=0.2) |
|
|||
215 |
|
||||
216 | else: |
|
206 | else: | |
217 | self.ploterr1.remove() |
|
207 | self.ploterr1.remove() | |
218 | self.ploterr2.remove() |
|
208 | self.ploterr2.remove() | |
@@ -220,17 +210,11 class SpectraObliquePlot(Plot): | |||||
220 | if self.showprofile: |
|
210 | if self.showprofile: | |
221 | ax.plt_profile.set_data(self.data['rti'][n][-1], y) |
|
211 | ax.plt_profile.set_data(self.data['rti'][n][-1], y) | |
222 | ax.plt_noise.set_data(numpy.repeat(noise, len(y)), y) |
|
212 | ax.plt_noise.set_data(numpy.repeat(noise, len(y)), y) | |
223 | if self.CODE == 'spc_moments': |
|
213 | self.ploterr1 = ax.errorbar(shift1, y, xerr=err1, fmt='k^',elinewidth=0.2,marker='x',linestyle='None',markersize=0.5,capsize=0.3,markeredgewidth=0.2) | |
224 | ax.plt_mean.set_data(mean, y) |
|
214 | self.ploterr2 = ax.errorbar(shift2, y, xerr=err2, fmt='m^',elinewidth=0.2,marker='x',linestyle='None',markersize=0.5,capsize=0.3,markeredgewidth=0.2) | |
225 | if self.CODE2 == 'spc_oblique': |
|
|||
226 | #ax.plt_shift1.set_data(shift1, y) |
|
|||
227 | #ax.plt_shift2.set_data(shift2, y) |
|
|||
228 | #ax.clf() |
|
|||
229 | self.ploterr1 = ax.errorbar(shift1, y, xerr=self.data.shift1_error,fmt='k^',elinewidth=0.2,marker='x',linestyle='None',markersize=0.5,capsize=0.3,markeredgewidth=0.2) |
|
|||
230 | self.ploterr2 = ax.errorbar(shift2, y, xerr=self.data.shift2_error,fmt='m^',elinewidth=0.2,marker='x',linestyle='None',markersize=0.5,capsize=0.3,markeredgewidth=0.2) |
|
|||
231 |
|
215 | |||
232 | self.titles.append('CH {}: {:3.2f}dB'.format(n, noise)) |
|
216 | self.titles.append('CH {}: {:3.2f}dB'.format(n, noise)) | |
233 | #self.titles.append('{}'.format('Velocidad Doppler')) |
|
217 | ||
234 |
|
218 | |||
235 | class CrossSpectraPlot(Plot): |
|
219 | class CrossSpectraPlot(Plot): | |
236 |
|
220 | |||
@@ -733,8 +717,6 class SpectrogramPlot(Plot): | |||||
733 | self.ncols = 1 |
|
717 | self.ncols = 1 | |
734 | self.nrows = len(self.data.channels) |
|
718 | self.nrows = len(self.data.channels) | |
735 | self.nplots = len(self.data.channels) |
|
719 | self.nplots = len(self.data.channels) | |
736 | #print(self.dataOut.heightList) |
|
|||
737 | #self.ylabel = 'Range [km]' |
|
|||
738 | self.xlabel = 'Time' |
|
720 | self.xlabel = 'Time' | |
739 | self.cb_label = 'dB' |
|
721 | self.cb_label = 'dB' | |
740 | self.plots_adjust.update({'hspace':1.2, 'left': 0.1, 'bottom': 0.12, 'right':0.95}) |
|
722 | self.plots_adjust.update({'hspace':1.2, 'left': 0.1, 'bottom': 0.12, 'right':0.95}) | |
@@ -742,18 +724,11 class SpectrogramPlot(Plot): | |||||
742 | self.CODE.upper(), x, self.data.heightList[self.data.hei], self.data.heightList[self.data.hei],self.data.heightList[self.data.hei]+(self.data.DH*self.data.nProfiles)) for x in range(self.nrows)] |
|
724 | self.CODE.upper(), x, self.data.heightList[self.data.hei], self.data.heightList[self.data.hei],self.data.heightList[self.data.hei]+(self.data.DH*self.data.nProfiles)) for x in range(self.nrows)] | |
743 |
|
725 | |||
744 | def plot(self): |
|
726 | def plot(self): | |
|
727 | ||||
745 | self.x = self.data.times |
|
728 | self.x = self.data.times | |
746 | #self.y = self.data.heights |
|
|||
747 | self.z = self.data[self.CODE] |
|
729 | self.z = self.data[self.CODE] | |
748 | self.y = self.data.xrange[0] |
|
730 | self.y = self.data.xrange[0] | |
749 | #import time |
|
731 | ||
750 | #print(time.ctime(self.x)) |
|
|||
751 |
|
||||
752 | ''' |
|
|||
753 | print(numpy.shape(self.x)) |
|
|||
754 | print(numpy.shape(self.y)) |
|
|||
755 | print(numpy.shape(self.z)) |
|
|||
756 | ''' |
|
|||
757 | self.ylabel = "Frequency (kHz)" |
|
732 | self.ylabel = "Frequency (kHz)" | |
758 |
|
733 | |||
759 | self.z = numpy.ma.masked_invalid(self.z) |
|
734 | self.z = numpy.ma.masked_invalid(self.z) |
@@ -1,5 +1,7 | |||||
1 |
|
1 | |||
2 | import os |
|
2 | import os | |
|
3 | import time | |||
|
4 | import math | |||
3 | import datetime |
|
5 | import datetime | |
4 | import numpy |
|
6 | import numpy | |
5 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator #YONG |
|
7 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator #YONG | |
@@ -13,27 +15,18 from schainpy.model.graphics.jroplot_base import Plot, plt | |||||
13 |
|
15 | |||
14 | import matplotlib.pyplot as plt |
|
16 | import matplotlib.pyplot as plt | |
15 | import matplotlib.colors as colors |
|
17 | import matplotlib.colors as colors | |
16 |
|
||||
17 | import time |
|
|||
18 | import math |
|
|||
19 |
|
||||
20 |
|
||||
21 | from matplotlib.ticker import MultipleLocator |
|
18 | from matplotlib.ticker import MultipleLocator | |
22 |
|
19 | |||
23 |
|
20 | |||
24 |
|
||||
25 | class RTIDPPlot(RTIPlot): |
|
21 | class RTIDPPlot(RTIPlot): | |
26 |
|
22 | |||
27 | ''' |
|
23 | '''Plot for RTI Double Pulse Experiment | |
28 | Plot for RTI Double Pulse Experiment |
|
|||
29 | ''' |
|
24 | ''' | |
30 |
|
25 | |||
31 | CODE = 'RTIDP' |
|
26 | CODE = 'RTIDP' | |
32 | colormap = 'jro' |
|
27 | colormap = 'jro' | |
33 | plot_name = 'RTI' |
|
28 | plot_name = 'RTI' | |
34 |
|
29 | |||
35 | #cb_label = 'Ne Electron Density (1/cm3)' |
|
|||
36 |
|
||||
37 | def setup(self): |
|
30 | def setup(self): | |
38 | self.xaxis = 'time' |
|
31 | self.xaxis = 'time' | |
39 | self.ncols = 1 |
|
32 | self.ncols = 1 | |
@@ -49,30 +42,25 class RTIDPPlot(RTIPlot): | |||||
49 |
|
42 | |||
50 | self.cb_label = 'Intensity (dB)' |
|
43 | self.cb_label = 'Intensity (dB)' | |
51 |
|
44 | |||
52 |
|
||||
53 | #self.cb_label = cb_label |
|
|||
54 |
|
||||
55 | self.titles = ['{} Channel {}'.format( |
|
45 | self.titles = ['{} Channel {}'.format( | |
56 | self.plot_name.upper(), '0x1'),'{} Channel {}'.format( |
|
46 | self.plot_name.upper(), '0x1'),'{} Channel {}'.format( | |
57 | self.plot_name.upper(), '0'),'{} Channel {}'.format( |
|
47 | self.plot_name.upper(), '0'),'{} Channel {}'.format( | |
58 | self.plot_name.upper(), '1')] |
|
48 | self.plot_name.upper(), '1')] | |
59 |
|
49 | |||
|
50 | def update(self, dataOut): | |||
60 |
|
51 | |||
61 | def plot(self): |
|
52 | data = {} | |
62 |
|
53 | meta = {} | ||
63 | self.data.normalize_heights() |
|
54 | data[self.CODE] = dataOut.data_for_RTI_DP | |
64 | self.x = self.data.times |
|
55 | data['NRANGE'] = dataOut.NDP | |
65 | self.y = self.data.heights[0:self.data.NDP] |
|
|||
66 |
|
56 | |||
67 | if self.showSNR: |
|
57 | return data, meta | |
68 | self.z = numpy.concatenate( |
|
|||
69 | (self.data[self.CODE], self.data['snr']) |
|
|||
70 | ) |
|
|||
71 | else: |
|
|||
72 |
|
58 | |||
73 | self.z = self.data[self.CODE] |
|
59 | def plot(self): | |
74 | #print(numpy.max(self.z[0,0:])) |
|
|||
75 |
|
60 | |||
|
61 | self.x = self.data.times | |||
|
62 | self.y = self.data.yrange[0: self.data['NRANGE']] | |||
|
63 | self.z = self.data[self.CODE] | |||
76 | self.z = numpy.ma.masked_invalid(self.z) |
|
64 | self.z = numpy.ma.masked_invalid(self.z) | |
77 |
|
65 | |||
78 | if self.decimation is None: |
|
66 | if self.decimation is None: | |
@@ -82,26 +70,21 class RTIDPPlot(RTIPlot): | |||||
82 |
|
70 | |||
83 | for n, ax in enumerate(self.axes): |
|
71 | for n, ax in enumerate(self.axes): | |
84 |
|
72 | |||
85 |
|
||||
86 | self.zmax = self.zmax if self.zmax is not None else numpy.max( |
|
73 | self.zmax = self.zmax if self.zmax is not None else numpy.max( | |
87 | self.z[1][0,12:40]) |
|
74 | self.z[1][0,12:40]) | |
88 | self.zmin = self.zmin if self.zmin is not None else numpy.min( |
|
75 | self.zmin = self.zmin if self.zmin is not None else numpy.min( | |
89 | self.z[1][0,12:40]) |
|
76 | self.z[1][0,12:40]) | |
90 |
|
77 | |||
91 |
|
||||
92 |
|
||||
93 | if ax.firsttime: |
|
78 | if ax.firsttime: | |
94 |
|
79 | |||
95 | if self.zlimits is not None: |
|
80 | if self.zlimits is not None: | |
96 | self.zmin, self.zmax = self.zlimits[n] |
|
81 | self.zmin, self.zmax = self.zlimits[n] | |
97 |
|
82 | |||
98 |
|
||||
99 | ax.plt = ax.pcolormesh(x, y, z[n].T * self.factors[n], |
|
83 | ax.plt = ax.pcolormesh(x, y, z[n].T * self.factors[n], | |
100 | vmin=self.zmin, |
|
84 | vmin=self.zmin, | |
101 | vmax=self.zmax, |
|
85 | vmax=self.zmax, | |
102 | cmap=self.cmaps[n] |
|
86 | cmap=self.cmaps[n] | |
103 | ) |
|
87 | ) | |
104 | #plt.tight_layout() |
|
|||
105 | else: |
|
88 | else: | |
106 | if self.zlimits is not None: |
|
89 | if self.zlimits is not None: | |
107 | self.zmin, self.zmax = self.zlimits[n] |
|
90 | self.zmin, self.zmax = self.zlimits[n] | |
@@ -111,7 +94,6 class RTIDPPlot(RTIPlot): | |||||
111 | vmax=self.zmax, |
|
94 | vmax=self.zmax, | |
112 | cmap=self.cmaps[n] |
|
95 | cmap=self.cmaps[n] | |
113 | ) |
|
96 | ) | |
114 | #plt.tight_layout() |
|
|||
115 |
|
97 | |||
116 |
|
98 | |||
117 | class RTILPPlot(RTIPlot): |
|
99 | class RTILPPlot(RTIPlot): | |
@@ -124,8 +106,6 class RTILPPlot(RTIPlot): | |||||
124 | colormap = 'jro' |
|
106 | colormap = 'jro' | |
125 | plot_name = 'RTI LP' |
|
107 | plot_name = 'RTI LP' | |
126 |
|
108 | |||
127 | #cb_label = 'Ne Electron Density (1/cm3)' |
|
|||
128 |
|
||||
129 | def setup(self): |
|
109 | def setup(self): | |
130 | self.xaxis = 'time' |
|
110 | self.xaxis = 'time' | |
131 | self.ncols = 1 |
|
111 | self.ncols = 1 | |
@@ -140,10 +120,6 class RTILPPlot(RTIPlot): | |||||
140 |
|
120 | |||
141 | self.cb_label = 'Intensity (dB)' |
|
121 | self.cb_label = 'Intensity (dB)' | |
142 |
|
122 | |||
143 |
|
||||
144 |
|
||||
145 | #self.cb_label = cb_label |
|
|||
146 |
|
||||
147 | self.titles = ['{} Channel {}'.format( |
|
123 | self.titles = ['{} Channel {}'.format( | |
148 | self.plot_name.upper(), '0'),'{} Channel {}'.format( |
|
124 | self.plot_name.upper(), '0'),'{} Channel {}'.format( | |
149 | self.plot_name.upper(), '1'),'{} Channel {}'.format( |
|
125 | self.plot_name.upper(), '1'),'{} Channel {}'.format( | |
@@ -175,7 +151,6 class RTILPPlot(RTIPlot): | |||||
175 |
|
151 | |||
176 | for n, ax in enumerate(self.axes): |
|
152 | for n, ax in enumerate(self.axes): | |
177 |
|
153 | |||
178 |
|
||||
179 | self.zmax = self.zmax if self.zmax is not None else numpy.max( |
|
154 | self.zmax = self.zmax if self.zmax is not None else numpy.max( | |
180 | self.z[1][0,12:40]) |
|
155 | self.z[1][0,12:40]) | |
181 | self.zmin = self.zmin if self.zmin is not None else numpy.min( |
|
156 | self.zmin = self.zmin if self.zmin is not None else numpy.min( | |
@@ -917,36 +892,37 class CrossProductsPlot(Plot): | |||||
917 | plot_name = 'Cross Products' |
|
892 | plot_name = 'Cross Products' | |
918 | plot_type = 'scatterbuffer' |
|
893 | plot_type = 'scatterbuffer' | |
919 |
|
894 | |||
920 |
|
||||
921 | def setup(self): |
|
895 | def setup(self): | |
922 |
|
896 | |||
923 | self.ncols = 3 |
|
897 | self.ncols = 3 | |
924 | self.nrows = 1 |
|
898 | self.nrows = 1 | |
925 | self.nplots = 3 |
|
899 | self.nplots = 3 | |
926 | self.ylabel = 'Range [km]' |
|
900 | self.ylabel = 'Range [km]' | |
927 |
|
||||
928 | self.width = 3.5*self.nplots |
|
901 | self.width = 3.5*self.nplots | |
929 | self.height = 5.5 |
|
902 | self.height = 5.5 | |
930 | self.colorbar = False |
|
903 | self.colorbar = False | |
931 | self.titles = [] |
|
904 | self.titles = [] | |
932 |
|
905 | |||
933 |
def |
|
906 | def update(self, dataOut): | |
934 |
|
||||
935 | self.x = self.data['crossprod'][:,-1,:,:,:,:] |
|
|||
936 |
|
||||
937 |
|
907 | |||
|
908 | data = {} | |||
|
909 | meta = {} | |||
938 |
|
910 | |||
|
911 | data['crossprod'] = dataOut.crossprods | |||
|
912 | data['NDP'] = dataOut.NDP | |||
939 |
|
913 | |||
940 | self.y = self.data.heights[0:self.data.NDP] |
|
914 | return data, meta | |
941 |
|
915 | |||
|
916 | def plot(self): | |||
942 |
|
917 | |||
|
918 | self.x = self.data['crossprod'][:,-1,:,:,:,:] | |||
|
919 | self.y = self.data.heights[0:self.data['NDP']] | |||
943 |
|
920 | |||
944 | for n, ax in enumerate(self.axes): |
|
921 | for n, ax in enumerate(self.axes): | |
945 |
|
922 | |||
946 | self.xmin=numpy.min(numpy.concatenate((self.x[n][0,20:30,0,0],self.x[n][1,20:30,0,0],self.x[n][2,20:30,0,0],self.x[n][3,20:30,0,0]))) |
|
923 | self.xmin=numpy.min(numpy.concatenate((self.x[n][0,20:30,0,0],self.x[n][1,20:30,0,0],self.x[n][2,20:30,0,0],self.x[n][3,20:30,0,0]))) | |
947 | self.xmax=numpy.max(numpy.concatenate((self.x[n][0,20:30,0,0],self.x[n][1,20:30,0,0],self.x[n][2,20:30,0,0],self.x[n][3,20:30,0,0]))) |
|
924 | self.xmax=numpy.max(numpy.concatenate((self.x[n][0,20:30,0,0],self.x[n][1,20:30,0,0],self.x[n][2,20:30,0,0],self.x[n][3,20:30,0,0]))) | |
948 |
|
925 | |||
949 |
|
||||
950 | if ax.firsttime: |
|
926 | if ax.firsttime: | |
951 |
|
927 | |||
952 | self.autoxticks=False |
|
928 | self.autoxticks=False | |
@@ -969,7 +945,6 class CrossProductsPlot(Plot): | |||||
969 | label4='kaxby' |
|
945 | label4='kaxby' | |
970 | self.xlimits.append((self.xmin,self.xmax)) |
|
946 | self.xlimits.append((self.xmin,self.xmax)) | |
971 |
|
947 | |||
972 |
|
||||
973 | ax.plotline1 = ax.plot(self.x[n][0,:,0,0], self.y, color='r',linewidth=2.0, label=label1) |
|
948 | ax.plotline1 = ax.plot(self.x[n][0,:,0,0], self.y, color='r',linewidth=2.0, label=label1) | |
974 | ax.plotline2 = ax.plot(self.x[n][1,:,0,0], self.y, color='k',linewidth=2.0, label=label2) |
|
949 | ax.plotline2 = ax.plot(self.x[n][1,:,0,0], self.y, color='k',linewidth=2.0, label=label2) | |
975 | ax.plotline3 = ax.plot(self.x[n][2,:,0,0], self.y, color='b',linewidth=2.0, label=label3) |
|
950 | ax.plotline3 = ax.plot(self.x[n][2,:,0,0], self.y, color='b',linewidth=2.0, label=label3) | |
@@ -977,8 +952,6 class CrossProductsPlot(Plot): | |||||
977 | ax.legend(loc='upper right') |
|
952 | ax.legend(loc='upper right') | |
978 | ax.set_xlim(self.xmin, self.xmax) |
|
953 | ax.set_xlim(self.xmin, self.xmax) | |
979 | self.titles.append('{}'.format(self.plot_name.upper())) |
|
954 | self.titles.append('{}'.format(self.plot_name.upper())) | |
980 | #plt.tight_layout() |
|
|||
981 |
|
||||
982 |
|
955 | |||
983 | else: |
|
956 | else: | |
984 |
|
957 | |||
@@ -989,14 +962,11 class CrossProductsPlot(Plot): | |||||
989 |
|
962 | |||
990 | ax.set_xlim(self.xmin, self.xmax) |
|
963 | ax.set_xlim(self.xmin, self.xmax) | |
991 |
|
964 | |||
992 |
|
||||
993 | ax.plotline1[0].set_data(self.x[n][0,:,0,0],self.y) |
|
965 | ax.plotline1[0].set_data(self.x[n][0,:,0,0],self.y) | |
994 | ax.plotline2[0].set_data(self.x[n][1,:,0,0],self.y) |
|
966 | ax.plotline2[0].set_data(self.x[n][1,:,0,0],self.y) | |
995 | ax.plotline3[0].set_data(self.x[n][2,:,0,0],self.y) |
|
967 | ax.plotline3[0].set_data(self.x[n][2,:,0,0],self.y) | |
996 | ax.plotline4[0].set_data(self.x[n][3,:,0,0],self.y) |
|
968 | ax.plotline4[0].set_data(self.x[n][3,:,0,0],self.y) | |
997 | self.titles.append('{}'.format(self.plot_name.upper())) |
|
969 | self.titles.append('{}'.format(self.plot_name.upper())) | |
998 | #plt.tight_layout() |
|
|||
999 |
|
||||
1000 |
|
970 | |||
1001 |
|
971 | |||
1002 | class CrossProductsLPPlot(Plot): |
|
972 | class CrossProductsLPPlot(Plot): |
@@ -19,4 +19,4 from .pxproc_parameters import * | |||||
19 | ###########DP########### |
|
19 | ###########DP########### | |
20 | from .jroproc_voltage_lags import * |
|
20 | from .jroproc_voltage_lags import * | |
21 | ###########DP########### |
|
21 | ###########DP########### | |
22 | from .jroproc_spectra_lags_faraday import * |
|
22 | # from .jroproc_spectra_lags_faraday import * |
@@ -1,12 +1,21 | |||||
|
1 | ||||
|
2 | import os | |||
1 | import sys |
|
3 | import sys | |
2 | import numpy,math |
|
4 | import numpy, math | |
3 | from scipy import interpolate |
|
5 | from scipy import interpolate | |
|
6 | from scipy.optimize import nnls | |||
4 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator |
|
7 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator | |
5 | from schainpy.model.data.jrodata import Voltage,hildebrand_sekhon |
|
8 | from schainpy.model.data.jrodata import Voltage,hildebrand_sekhon | |
6 | from schainpy.utils import log |
|
9 | from schainpy.utils import log | |
7 | from time import time, mktime, strptime, gmtime, ctime |
|
10 | from time import time, mktime, strptime, gmtime, ctime | |
8 | import os |
|
|||
9 |
|
11 | |||
|
12 | try: | |||
|
13 | from schainpy.model.proc import fitacf_guess | |||
|
14 | from schainpy.model.proc import fitacf_fit_short | |||
|
15 | from schainpy.model.proc import fitacf_acf2 | |||
|
16 | from schainpy.model.proc import full_profile_profile | |||
|
17 | except: | |||
|
18 | log.warning('Missing Faraday fortran libs') | |||
10 |
|
19 | |||
11 | class VoltageProc(ProcessingUnit): |
|
20 | class VoltageProc(ProcessingUnit): | |
12 |
|
21 | |||
@@ -1979,8 +1988,6 class suppress_stdout_stderr(object): | |||||
1979 | os.close(fd) |
|
1988 | os.close(fd) | |
1980 |
|
1989 | |||
1981 |
|
1990 | |||
1982 | from schainpy.model.proc import fitacf_guess |
|
|||
1983 | from schainpy.model.proc import fitacf_fit_short |
|
|||
1984 | class DPTemperaturesEstimation(Operation): |
|
1991 | class DPTemperaturesEstimation(Operation): | |
1985 | """Operation to estimate temperatures for Double Pulse data. |
|
1992 | """Operation to estimate temperatures for Double Pulse data. | |
1986 |
|
1993 | |||
@@ -2184,7 +2191,6 class NeTeTiRecal(NormalizeDPPower,DPTemperaturesEstimation): | |||||
2184 | return dataOut |
|
2191 | return dataOut | |
2185 |
|
2192 | |||
2186 |
|
2193 | |||
2187 | from schainpy.model.proc import fitacf_acf2 |
|
|||
2188 | class DenCorrection(Operation): |
|
2194 | class DenCorrection(Operation): | |
2189 |
|
2195 | |||
2190 | def __init__(self, **kwargs): |
|
2196 | def __init__(self, **kwargs): | |
@@ -5366,8 +5372,6 class SumFlipsHP(SumFlips): | |||||
5366 | return dataOut |
|
5372 | return dataOut | |
5367 |
|
5373 | |||
5368 |
|
5374 | |||
5369 | from schainpy.model.proc import full_profile_profile |
|
|||
5370 | from scipy.optimize import nnls |
|
|||
5371 | class LongPulseAnalysis(Operation): |
|
5375 | class LongPulseAnalysis(Operation): | |
5372 | """Operation to estimate ACFs, temperatures, total electron density and Hydrogen/Helium fractions from the Long Pulse data. |
|
5376 | """Operation to estimate ACFs, temperatures, total electron density and Hydrogen/Helium fractions from the Long Pulse data. | |
5373 |
|
5377 |
General Comments 0
You need to be logged in to leave comments.
Login now