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