##// END OF EJS Templates
Now RTIPlot and SpcPlot can show different dBrange
rflores -
r1550:f7e4a1824cf4
parent child
Show More
@@ -407,7 +407,7 class Plot(Operation):
407 ax.set_ylabel(self.ylabel)
407 ax.set_ylabel(self.ylabel)
408 if self.showprofile:
408 if self.showprofile:
409 self.pf_axes[n].set_ylim(ymin, ymax)
409 self.pf_axes[n].set_ylim(ymin, ymax)
410 self.pf_axes[n].set_xlim(self.zmin, self.zmax)
410 self.pf_axes[n].set_xlim(self.zmin[n], self.zmax[n])
411 self.pf_axes[n].set_xlabel('dB')
411 self.pf_axes[n].set_xlabel('dB')
412 self.pf_axes[n].grid(b=True, axis='x')
412 self.pf_axes[n].grid(b=True, axis='x')
413 [tick.set_visible(False)
413 [tick.set_visible(False)
@@ -8,6 +8,7
8
8
9 import os
9 import os
10 import numpy
10 import numpy
11 import collections.abc
11
12
12 from schainpy.model.graphics.jroplot_base import Plot, plt, log
13 from schainpy.model.graphics.jroplot_base import Plot, plt, log
13
14
@@ -94,6 +95,17 class SpectraPlot(Plot):
94
95
95 self.CODE2 = 'spc_oblique'
96 self.CODE2 = 'spc_oblique'
96
97
98 if not isinstance(self.zmin, collections.abc.Sequence):
99 if not self.zmin:
100 self.zmin = [numpy.min(self.z)]*len(self.axes)
101 else:
102 self.zmin = [self.zmin]*len(self.axes)
103
104 if not isinstance(self.zmax, collections.abc.Sequence):
105 if not self.zmax:
106 self.zmax = [numpy.max(self.z)]*len(self.axes)
107 else:
108 self.zmax = [self.zmax]*len(self.axes)
97
109
98 for n, ax in enumerate(self.axes):
110 for n, ax in enumerate(self.axes):
99 noise = data['noise'][n]
111 noise = data['noise'][n]
@@ -105,12 +117,12 class SpectraPlot(Plot):
105 if ax.firsttime:
117 if ax.firsttime:
106 self.xmax = self.xmax if self.xmax else numpy.nanmax(x)
118 self.xmax = self.xmax if self.xmax else numpy.nanmax(x)
107 self.xmin = self.xmin if self.xmin else numpy.nanmin(x)#-self.xmax
119 self.xmin = self.xmin if self.xmin else numpy.nanmin(x)#-self.xmax
108 self.zmin = self.zmin if self.zmin else numpy.nanmin(z)
120 #self.zmin = self.zmin if self.zmin else numpy.nanmin(z)
109 self.zmax = self.zmax if self.zmax else numpy.nanmax(z)
121 #self.zmax = self.zmax if self.zmax else numpy.nanmax(z)
110
122
111 ax.plt = ax.pcolormesh(x, y, z[n].T,
123 ax.plt = ax.pcolormesh(x, y, z[n].T,
112 vmin=self.zmin,
124 vmin=self.zmin[n],
113 vmax=self.zmax,
125 vmax=self.zmax[n],
114 cmap=plt.get_cmap(self.colormap),
126 cmap=plt.get_cmap(self.colormap),
115 )
127 )
116
128
@@ -713,14 +725,28 class RTIPlot(Plot):
713 else:
725 else:
714 x, y, z = self.fill_gaps(*self.decimate())
726 x, y, z = self.fill_gaps(*self.decimate())
715
727
728
729 if not isinstance(self.zmin, collections.abc.Sequence):
730 if not self.zmin:
731 self.zmin = [numpy.min(self.z)]*len(self.axes)
732 else:
733 self.zmin = [self.zmin]*len(self.axes)
734
735 if not isinstance(self.zmax, collections.abc.Sequence):
736 if not self.zmax:
737 self.zmax = [numpy.max(self.z)]*len(self.axes)
738 else:
739 self.zmax = [self.zmax]*len(self.axes)
740
716 for n, ax in enumerate(self.axes):
741 for n, ax in enumerate(self.axes):
717 self.zmin = self.zmin if self.zmin else numpy.min(self.z)
742
718 self.zmax = self.zmax if self.zmax else numpy.max(self.z)
743 #self.zmin = self.zmin if self.zmin else numpy.min(self.z)
744 #self.zmax = self.zmax if self.zmax else numpy.max(self.z)
719
745
720 if ax.firsttime:
746 if ax.firsttime:
721 ax.plt = ax.pcolormesh(x, y, z[n].T,
747 ax.plt = ax.pcolormesh(x, y, z[n].T,
722 vmin=self.zmin,
748 vmin=self.zmin[n],
723 vmax=self.zmax,
749 vmax=self.zmax[n],
724 cmap=plt.get_cmap(self.colormap)
750 cmap=plt.get_cmap(self.colormap)
725 )
751 )
726 if self.showprofile:
752 if self.showprofile:
@@ -731,8 +757,8 class RTIPlot(Plot):
731 else:
757 else:
732 ax.collections.remove(ax.collections[0])
758 ax.collections.remove(ax.collections[0])
733 ax.plt = ax.pcolormesh(x, y, z[n].T,
759 ax.plt = ax.pcolormesh(x, y, z[n].T,
734 vmin=self.zmin,
760 vmin=self.zmin[n],
735 vmax=self.zmax,
761 vmax=self.zmax[n],
736 cmap=plt.get_cmap(self.colormap)
762 cmap=plt.get_cmap(self.colormap)
737 )
763 )
738 if self.showprofile:
764 if self.showprofile:
@@ -4,6 +4,7 import time
4 import math
4 import math
5 import datetime
5 import datetime
6 import numpy
6 import numpy
7 import collections.abc
7 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator #YONG
8 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator #YONG
8
9
9 from .jroplot_spectra import RTIPlot, NoisePlot
10 from .jroplot_spectra import RTIPlot, NoisePlot
@@ -110,7 +111,7 class RTILPPlot(RTIPlot):
110 def setup(self):
111 def setup(self):
111 self.xaxis = 'time'
112 self.xaxis = 'time'
112 self.ncols = 1
113 self.ncols = 1
113 self.nrows = 4
114 self.nrows = 2
114 self.nplots = self.nrows
115 self.nplots = self.nrows
115
116
116 self.ylabel = 'Range [km]'
117 self.ylabel = 'Range [km]'
@@ -152,12 +153,24 class RTILPPlot(RTIPlot):
152 else:
153 else:
153 x, y, z = self.fill_gaps(*self.decimate())
154 x, y, z = self.fill_gaps(*self.decimate())
154
155
156 if not isinstance(self.zmin, collections.abc.Sequence):
157 if not self.zmin:
158 self.zmin = [numpy.min(self.z)]*len(self.axes)
159 else:
160 self.zmin = [self.zmin]*len(self.axes)
161
162 if not isinstance(self.zmax, collections.abc.Sequence):
163 if not self.zmax:
164 self.zmax = [numpy.max(self.z)]*len(self.axes)
165 else:
166 self.zmax = [self.zmax]*len(self.axes)
167
155 for n, ax in enumerate(self.axes):
168 for n, ax in enumerate(self.axes):
156
169
157 self.zmax = self.zmax if self.zmax is not None else numpy.max(
170 #self.zmax = self.zmax if self.zmax is not None else numpy.max(
158 self.z[1][0,12:40])
171 #self.z[1][0,12:40])
159 self.zmin = self.zmin if self.zmin is not None else numpy.min(
172 #self.zmin = self.zmin if self.zmin is not None else numpy.min(
160 self.z[1][0,12:40])
173 #self.z[1][0,12:40])
161
174
162 if ax.firsttime:
175 if ax.firsttime:
163
176
@@ -166,8 +179,8 class RTILPPlot(RTIPlot):
166
179
167
180
168 ax.plt = ax.pcolormesh(x, y, z[n].T,
181 ax.plt = ax.pcolormesh(x, y, z[n].T,
169 vmin=self.zmin,
182 vmin=self.zmin[n],
170 vmax=self.zmax,
183 vmax=self.zmax[n],
171 cmap=plt.get_cmap(self.colormap)
184 cmap=plt.get_cmap(self.colormap)
172 )
185 )
173
186
@@ -176,8 +189,8 class RTILPPlot(RTIPlot):
176 #self.zmin, self.zmax = self.zlimits[n]
189 #self.zmin, self.zmax = self.zlimits[n]
177 ax.collections.remove(ax.collections[0])
190 ax.collections.remove(ax.collections[0])
178 ax.plt = ax.pcolormesh(x, y, z[n].T,
191 ax.plt = ax.pcolormesh(x, y, z[n].T,
179 vmin=self.zmin,
192 vmin=self.zmin[n],
180 vmax=self.zmax,
193 vmax=self.zmax[n],
181 cmap=plt.get_cmap(self.colormap)
194 cmap=plt.get_cmap(self.colormap)
182 )
195 )
183
196
@@ -618,6 +631,7 class FracsHPPlot(Plot):
618 ax.errorbar(phe, self.y[cut:], fmt='k^', xerr=ephe,elinewidth=1.0,color='b',linewidth=2.0, label='He+')
631 ax.errorbar(phe, self.y[cut:], fmt='k^', xerr=ephe,elinewidth=1.0,color='b',linewidth=2.0, label='He+')
619 plt.legend(loc='lower right')
632 plt.legend(loc='lower right')
620 ax.yaxis.set_minor_locator(MultipleLocator(15))
633 ax.yaxis.set_minor_locator(MultipleLocator(15))
634 ax.grid(which='minor')
621
635
622 class EDensityPlot(Plot):
636 class EDensityPlot(Plot):
623 '''
637 '''
@@ -6745,5 +6745,5 class MergeProc(ProcessingUnit):
6745 self.dataOut.NRANGE = self.dataOut.data_acf.shape[-1]
6745 self.dataOut.NRANGE = self.dataOut.data_acf.shape[-1]
6746 '''
6746 '''
6747 #print(numpy.shape(self.dataOut.data_spc))
6747 #print(numpy.shape(self.dataOut.data_spc))
6748 print("*************************GOOD*************************")
6748 #print("*************************GOOD*************************")
6749 #exit(1)
6749 #exit(1)
@@ -510,7 +510,7 class removeDCLagFlip(Operation):
510
510
511
511
512 def run(self, dataOut, mode=2):
512 def run(self, dataOut, mode=2):
513 print("***********************************Remove DC***********************************")
513 #print("***********************************Remove DC***********************************")
514 ##print(dataOut.FlipChannels)
514 ##print(dataOut.FlipChannels)
515 #exit(1)
515 #exit(1)
516 self.dataOut = dataOut
516 self.dataOut = dataOut
@@ -5089,6 +5089,9 class DataSaveCleanerHP(Operation):
5089 dataOut.acfs_LP=dataOut.acfs_LP.transpose()
5089 dataOut.acfs_LP=dataOut.acfs_LP.transpose()
5090 dataOut.acfs_error_LP=dataOut.acfs_error_LP.transpose()
5090 dataOut.acfs_error_LP=dataOut.acfs_error_LP.transpose()
5091
5091
5092 dataOut.DensityFinal *= 1.e6 #Convert units to m^⁻3
5093 dataOut.EDensityFinal *= 1.e6 #Convert units to m^⁻3
5094
5092 return dataOut
5095 return dataOut
5093
5096
5094
5097
@@ -7255,7 +7258,7 class IntegrationHP(IntegrationDP):
7255 #print(dataOut.kabxys_integrated[8][53,6,0]+dataOut.kabxys_integrated[11][53,6,0])
7258 #print(dataOut.kabxys_integrated[8][53,6,0]+dataOut.kabxys_integrated[11][53,6,0])
7256 #print(dataOut.kabxys_integrated[8][53,9,0]+dataOut.kabxys_integrated[11][53,9,0])
7259 #print(dataOut.kabxys_integrated[8][53,9,0]+dataOut.kabxys_integrated[11][53,9,0])
7257 #exit(1)
7260 #exit(1)
7258 print(dataOut.flagNoData)
7261 #print(dataOut.flagNoData)
7259 return dataOut
7262 return dataOut
7260
7263
7261 class SumFlipsHP(SumFlips):
7264 class SumFlipsHP(SumFlips):
General Comments 0
You need to be logged in to leave comments. Login now