@@ -257,6 +257,7 class Plot(Operation): | |||||
257 | self.mode = kwargs.get('mode', None) |
|
257 | self.mode = kwargs.get('mode', None) | |
258 |
|
258 | |||
259 |
|
259 | |||
|
260 | ||||
260 | if self.server: |
|
261 | if self.server: | |
261 | if not self.server.startswith('tcp://'): |
|
262 | if not self.server.startswith('tcp://'): | |
262 | self.server = 'tcp://{}'.format(self.server) |
|
263 | self.server = 'tcp://{}'.format(self.server) | |
@@ -514,6 +515,7 class Plot(Operation): | |||||
514 | self.save_time = self.data.max_time |
|
515 | self.save_time = self.data.max_time | |
515 |
|
516 | |||
516 | fig = self.figures[n] |
|
517 | fig = self.figures[n] | |
|
518 | print("save_code",self.save_code) | |||
517 | if self.throttle == 0: |
|
519 | if self.throttle == 0: | |
518 | if self.oneFigure: |
|
520 | if self.oneFigure: | |
519 | figname = os.path.join( |
|
521 | figname = os.path.join( |
@@ -7,7 +7,7 from schainpy.model.graphics.jroplot_base import Plot, plt | |||||
7 | from schainpy.model.graphics.jroplot_spectra import SpectraPlot, RTIPlot, CoherencePlot, SpectraCutPlot |
|
7 | from schainpy.model.graphics.jroplot_spectra import SpectraPlot, RTIPlot, CoherencePlot, SpectraCutPlot | |
8 | from schainpy.utils import log |
|
8 | from schainpy.utils import log | |
9 | # libreria wradlib |
|
9 | # libreria wradlib | |
10 | import wradlib as wrl |
|
10 | #import wradlib as wrl | |
11 |
|
11 | |||
12 | EARTH_RADIUS = 6.3710e3 |
|
12 | EARTH_RADIUS = 6.3710e3 | |
13 |
|
13 | |||
@@ -1176,7 +1176,11 class Weather_vRF_Plot(Plot): | |||||
1176 | r = numpy.arange(len(r_mask))*delta_height |
|
1176 | r = numpy.arange(len(r_mask))*delta_height | |
1177 | self.y = 2*r |
|
1177 | self.y = 2*r | |
1178 |
|
1178 | |||
1179 | z = data['data'][self.channels[0]][:,r_mask] |
|
1179 | try: | |
|
1180 | z = data['data'][self.channels[0]][:,r_mask] | |||
|
1181 | ||||
|
1182 | except: | |||
|
1183 | z = data['data'][0][:,r_mask] | |||
1180 |
|
1184 | |||
1181 | self.titles = [] |
|
1185 | self.titles = [] | |
1182 |
|
1186 | |||
@@ -1791,3 +1795,138 class WeatherRHI_vRF4_Plot(Plot): | |||||
1791 | self.titles = ['RHI {} at AZ: {} Channel {}'.format(self.labels[x], str(round(numpy.mean(data['azi']),1)), x) for x in range(self.nrows)] |
|
1795 | self.titles = ['RHI {} at AZ: {} Channel {}'.format(self.labels[x], str(round(numpy.mean(data['azi']),1)), x) for x in range(self.nrows)] | |
1792 | else: |
|
1796 | else: | |
1793 | self.titles = ['RHI {} at AZ: {} Channel {}'.format(self.labels[0], str(round(numpy.mean(data['azi']),1)), self.channels[0])] |
|
1797 | self.titles = ['RHI {} at AZ: {} Channel {}'.format(self.labels[0], str(round(numpy.mean(data['azi']),1)), self.channels[0])] | |
|
1798 | ||||
|
1799 | class WeatherParamsPlot(Plot): | |||
|
1800 | #CODE = 'RHI' | |||
|
1801 | #plot_name = 'RHI' | |||
|
1802 | #plot_type = 'rhistyle' | |||
|
1803 | buffering = False | |||
|
1804 | ||||
|
1805 | def setup(self): | |||
|
1806 | ||||
|
1807 | self.ncols = 1 | |||
|
1808 | self.nrows = 1 | |||
|
1809 | self.nplots= 1 | |||
|
1810 | self.ylabel= 'Range [Km]' | |||
|
1811 | self.xlabel= 'Range [Km]' | |||
|
1812 | self.polar = True | |||
|
1813 | self.grid = True | |||
|
1814 | if self.channels is not None: | |||
|
1815 | self.nplots = len(self.channels) | |||
|
1816 | self.nrows = len(self.channels) | |||
|
1817 | else: | |||
|
1818 | self.nplots = self.data.shape(self.CODE)[0] | |||
|
1819 | self.nrows = self.nplots | |||
|
1820 | self.channels = list(range(self.nplots)) | |||
|
1821 | ||||
|
1822 | self.colorbar=True | |||
|
1823 | self.width =8 | |||
|
1824 | self.height =8 | |||
|
1825 | self.ini =0 | |||
|
1826 | self.len_azi =0 | |||
|
1827 | self.buffer_ini = None | |||
|
1828 | self.buffer_ele = None | |||
|
1829 | self.plots_adjust.update({'wspace': 0.4, 'hspace':0.4, 'left': 0.1, 'right': 0.9, 'bottom': 0.08}) | |||
|
1830 | self.flag =0 | |||
|
1831 | self.indicador= 0 | |||
|
1832 | self.last_data_ele = None | |||
|
1833 | self.val_mean = None | |||
|
1834 | ||||
|
1835 | def update(self, dataOut): | |||
|
1836 | ||||
|
1837 | data = {} | |||
|
1838 | meta = {} | |||
|
1839 | if hasattr(dataOut, 'dataPP_POWER'): | |||
|
1840 | factor = 1 | |||
|
1841 | if hasattr(dataOut, 'nFFTPoints'): | |||
|
1842 | factor = dataOut.normFactor | |||
|
1843 | ||||
|
1844 | if 'pow' in self.attr_data[0].lower(): | |||
|
1845 | data['data'] = 10*numpy.log10(getattr(dataOut, self.attr_data[0])/(factor)) | |||
|
1846 | else: | |||
|
1847 | data['data'] = getattr(dataOut, self.attr_data[0])/(factor) | |||
|
1848 | ||||
|
1849 | if dataOut.mode_op == 'PPI': | |||
|
1850 | self.CODE = 'PPI' | |||
|
1851 | self.title = self.CODE | |||
|
1852 | elif dataOut.mode_op == 'RHI': | |||
|
1853 | self.CODE = 'RHI' | |||
|
1854 | self.title = self.CODE | |||
|
1855 | ||||
|
1856 | data['azi'] = dataOut.data_azi | |||
|
1857 | data['ele'] = dataOut.data_ele | |||
|
1858 | data['mode_op'] = dataOut.mode_op | |||
|
1859 | ||||
|
1860 | return data, meta | |||
|
1861 | ||||
|
1862 | def plot(self): | |||
|
1863 | data = self.data[-1] | |||
|
1864 | r = self.data.yrange | |||
|
1865 | delta_height = r[1]-r[0] | |||
|
1866 | r_mask = numpy.where(r>=0)[0] | |||
|
1867 | self.r_mask =r_mask | |||
|
1868 | r = numpy.arange(len(r_mask))*delta_height | |||
|
1869 | self.y = 2*r | |||
|
1870 | ||||
|
1871 | try: | |||
|
1872 | z = data['data'][self.channels[0]][:,r_mask] | |||
|
1873 | except: | |||
|
1874 | z = data['data'][0][:,r_mask] | |||
|
1875 | ||||
|
1876 | self.titles = [] | |||
|
1877 | ||||
|
1878 | self.ymax = self.ymax if self.ymax else numpy.nanmax(r) | |||
|
1879 | self.ymin = self.ymin if self.ymin else numpy.nanmin(r) | |||
|
1880 | self.zmax = self.zmax if self.zmax else numpy.nanmax(z) | |||
|
1881 | self.zmin = self.zmin if self.zmin else numpy.nanmin(z) | |||
|
1882 | print("mode inside plot",self.data['mode_op'],data['mode_op']) | |||
|
1883 | if data['mode_op'] == 'RHI': | |||
|
1884 | try: | |||
|
1885 | if self.data['mode_op'][-2] == 'PPI': | |||
|
1886 | self.ang_min = None | |||
|
1887 | self.ang_max = None | |||
|
1888 | except: | |||
|
1889 | pass | |||
|
1890 | self.ang_min = self.ang_min if self.ang_min else 0 | |||
|
1891 | self.ang_max = self.ang_max if self.ang_max else 90 | |||
|
1892 | r, theta = numpy.meshgrid(r, numpy.radians(data['ele']) ) | |||
|
1893 | elif data['mode_op'] == 'PPI': | |||
|
1894 | try: | |||
|
1895 | if self.data['mode_op'][-2] == 'RHI': | |||
|
1896 | self.ang_min = None | |||
|
1897 | self.ang_max = None | |||
|
1898 | except: | |||
|
1899 | pass | |||
|
1900 | self.ang_min = self.ang_min if self.ang_min else 0 | |||
|
1901 | self.ang_max = self.ang_max if self.ang_max else 360 | |||
|
1902 | r, theta = numpy.meshgrid(r, numpy.radians(data['azi']) ) | |||
|
1903 | ||||
|
1904 | self.clear_figures() | |||
|
1905 | ||||
|
1906 | for i,ax in enumerate(self.axes): | |||
|
1907 | ||||
|
1908 | if ax.firsttime: | |||
|
1909 | ax.set_xlim(numpy.radians(self.ang_min),numpy.radians(self.ang_max)) | |||
|
1910 | ax.plt = ax.pcolormesh(theta, r, z, cmap=self.colormap, vmin=self.zmin, vmax=self.zmax) | |||
|
1911 | if data['mode_op'] == 'PPI': | |||
|
1912 | ax.set_theta_direction(-1) | |||
|
1913 | else: | |||
|
1914 | ax.set_xlim(numpy.radians(self.ang_min),numpy.radians(self.ang_max)) | |||
|
1915 | ax.plt = ax.pcolormesh(theta, r, z, cmap=self.colormap, vmin=self.zmin, vmax=self.zmax) | |||
|
1916 | if data['mode_op'] == 'PPI': | |||
|
1917 | ax.set_theta_direction(-1) | |||
|
1918 | ax.grid(True) | |||
|
1919 | if data['mode_op'] == 'RHI': | |||
|
1920 | len_aux = int(data['azi'].shape[0]/4) | |||
|
1921 | mean = numpy.mean(data['azi'][len_aux:-len_aux]) | |||
|
1922 | if len(self.channels) !=1: | |||
|
1923 | self.titles = ['RHI {} at AZ: {} Channel {}'.format(self.labels[x], str(round(mean,1)), x) for x in range(self.nrows)] | |||
|
1924 | else: | |||
|
1925 | self.titles = ['RHI {} at AZ: {} Channel {}'.format(self.labels[0], str(round(mean,1)), self.channels[0])] | |||
|
1926 | elif data['mode_op'] == 'PPI': | |||
|
1927 | len_aux = int(data['ele'].shape[0]/4) | |||
|
1928 | mean = numpy.mean(data['ele'][len_aux:-len_aux]) | |||
|
1929 | if len(self.channels) !=1: | |||
|
1930 | self.titles = ['PPI {} at EL: {} Channel {}'.format(self.self.labels[x], str(round(mean,1)), x) for x in range(self.nrows)] | |||
|
1931 | else: | |||
|
1932 | self.titles = ['PPI {} at EL: {} Channel {}'.format(self.labels[0], str(round(mean,1)), self.channels[0])] |
@@ -408,7 +408,6 class DigitalRFReader(ProcessingUnit): | |||||
408 |
|
408 | |||
409 |
|
409 | |||
410 | self.__samples_to_read = int(nSamples) # FIJO: AHORA 40 |
|
410 | self.__samples_to_read = int(nSamples) # FIJO: AHORA 40 | |
411 | #self.__samples_to_read = int(1000000) # FIJO: AHORA 40 |
|
|||
412 | self.__nChannels = len(self.__channelList) |
|
411 | self.__nChannels = len(self.__channelList) | |
413 | #print("------------------------------------------") |
|
412 | #print("------------------------------------------") | |
414 | #print("self.__samples_to_read",self.__samples_to_read) |
|
413 | #print("self.__samples_to_read",self.__samples_to_read) | |
@@ -523,8 +522,6 class DigitalRFReader(ProcessingUnit): | |||||
523 | for indexSubchannel in range(self.__num_subchannels): |
|
522 | for indexSubchannel in range(self.__num_subchannels): | |
524 | try: |
|
523 | try: | |
525 | t0 = time() |
|
524 | t0 = time() | |
526 | #print("Unitindex",self.__thisUnixSample) |
|
|||
527 | #print("__samples_to_read",self.__samples_to_read) |
|
|||
528 | result = self.digitalReadObj.read_vector_c81d(self.__thisUnixSample, |
|
525 | result = self.digitalReadObj.read_vector_c81d(self.__thisUnixSample, | |
529 | self.__samples_to_read, |
|
526 | self.__samples_to_read, | |
530 | thisChannelName, sub_channel=indexSubchannel) |
|
527 | thisChannelName, sub_channel=indexSubchannel) | |
@@ -637,7 +634,6 class DigitalRFReader(ProcessingUnit): | |||||
637 | # ojo debo anadir el readNextBLock y el __isBufferEmpty( |
|
634 | # ojo debo anadir el readNextBLock y el __isBufferEmpty( | |
638 | self.dataOut.flagNoData = False |
|
635 | self.dataOut.flagNoData = False | |
639 | buffer = self.__data_buffer[:,self.__bufferIndex:self.__bufferIndex + self.__samples_to_read] |
|
636 | buffer = self.__data_buffer[:,self.__bufferIndex:self.__bufferIndex + self.__samples_to_read] | |
640 | #print("test",self.__bufferIndex) |
|
|||
641 | buffer = buffer.reshape((self.__nChannels, self.nProfileBlocks, int(self.__samples_to_read/self.nProfileBlocks))) |
|
637 | buffer = buffer.reshape((self.__nChannels, self.nProfileBlocks, int(self.__samples_to_read/self.nProfileBlocks))) | |
642 | self.dataOut.nProfileBlocks = self.nProfileBlocks |
|
638 | self.dataOut.nProfileBlocks = self.nProfileBlocks | |
643 | self.dataOut.data = buffer |
|
639 | self.dataOut.data = buffer |
@@ -557,10 +557,14 class HDFWriter(Operation): | |||||
557 | #Z_SOPHy_Az40.0_20200505_14:02:15.h5 |
|
557 | #Z_SOPHy_Az40.0_20200505_14:02:15.h5 | |
558 | if self.dataOut.flagMode == 1: #'AZI' #PPI |
|
558 | if self.dataOut.flagMode == 1: #'AZI' #PPI | |
559 | ang_type = 'El' |
|
559 | ang_type = 'El' | |
560 |
|
|
560 | len_aux = int(self.dataOut.data_ele.shape[0]/4) | |
|
561 | mean = numpy.mean(self.dataOut.data_ele[len_aux:-len:aux]) | |||
|
562 | ang_ = round(mean,1) | |||
561 | elif self.dataOut.flagMode == 0: #'ELE' #RHI |
|
563 | elif self.dataOut.flagMode == 0: #'ELE' #RHI | |
562 | ang_type = 'Az' |
|
564 | ang_type = 'Az' | |
563 |
|
|
565 | len_aux = int(self.dataOut.data_azi.shape[0]/4) | |
|
566 | mean = numpy.mean(self.dataOut.data_azi[len_aux:-len:aux]) | |||
|
567 | ang_ = round(mean,1) | |||
564 |
|
568 | |||
565 | file = '%s%s%s%2.1f%s%2.2d%2.2d%2.2d%s%2.2d%2.2d%2.2d%s' % (wr_type, |
|
569 | file = '%s%s%s%2.1f%s%2.2d%2.2d%2.2d%s%2.2d%2.2d%2.2d%s' % (wr_type, | |
566 | '_SOPHy_', |
|
570 | '_SOPHy_', | |
@@ -587,7 +591,7 class HDFWriter(Operation): | |||||
587 | self.filename = os.path.join( path, subfolder, file ) |
|
591 | self.filename = os.path.join( path, subfolder, file ) | |
588 |
|
592 | |||
589 | #Setting HDF5 File |
|
593 | #Setting HDF5 File | |
590 | print("filename",self.filename) |
|
594 | #print("filename",self.filename) | |
591 | self.fp = h5py.File(self.filename, 'w') |
|
595 | self.fp = h5py.File(self.filename, 'w') | |
592 | #write metadata |
|
596 | #write metadata | |
593 | self.writeMetadata(self.fp) |
|
597 | self.writeMetadata(self.fp) |
@@ -143,6 +143,8 class ParametersProc(ProcessingUnit): | |||||
143 |
|
143 | |||
144 | if hasattr(self.dataIn, 'dataPP_CCF'): |
|
144 | if hasattr(self.dataIn, 'dataPP_CCF'): | |
145 | self.dataOut.dataPP_CCF = self.dataIn.dataPP_CCF |
|
145 | self.dataOut.dataPP_CCF = self.dataIn.dataPP_CCF | |
|
146 | if hasattr(self.dataIn, 'flagAskMode'): | |||
|
147 | self.dataOut.flagAskMode = self.dataIn.flagAskMode | |||
146 |
|
148 | |||
147 | return |
|
149 | return | |
148 |
|
150 | |||
@@ -3927,7 +3929,7 class WeatherRadar(Operation): | |||||
3927 |
|
3929 | |||
3928 | def setup(self,dataOut,variableList= None,Pt=0,Gt=0,Gr=0,Glna=0,lambda_=0, aL=0, |
|
3930 | def setup(self,dataOut,variableList= None,Pt=0,Gt=0,Gr=0,Glna=0,lambda_=0, aL=0, | |
3929 | tauW= 0,thetaT=0,thetaR=0,Km =0): |
|
3931 | tauW= 0,thetaT=0,thetaR=0,Km =0): | |
3930 | print("INICIO") |
|
3932 | ||
3931 | self.nCh = dataOut.nChannels |
|
3933 | self.nCh = dataOut.nChannels | |
3932 | self.nHeis = dataOut.nHeights |
|
3934 | self.nHeis = dataOut.nHeights | |
3933 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
3935 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] | |
@@ -3950,7 +3952,7 class WeatherRadar(Operation): | |||||
3950 | self.RadarConstant = Numerator/Denominator |
|
3952 | self.RadarConstant = Numerator/Denominator | |
3951 | if self.variableList== None: |
|
3953 | if self.variableList== None: | |
3952 | self.variableList= ['Reflectividad','ReflectividadDiferencial','CoeficienteCorrelacion','FaseDiferencial','VelocidadRadial','AnchoEspectral'] |
|
3954 | self.variableList= ['Reflectividad','ReflectividadDiferencial','CoeficienteCorrelacion','FaseDiferencial','VelocidadRadial','AnchoEspectral'] | |
3953 | print('FIN') |
|
3955 | ||
3954 | def setMoments(self,dataOut,i): |
|
3956 | def setMoments(self,dataOut,i): | |
3955 |
|
3957 | |||
3956 | type = dataOut.inputUnit |
|
3958 | type = dataOut.inputUnit | |
@@ -4013,7 +4015,7 class WeatherRadar(Operation): | |||||
4013 | self.n_radar = numpy.zeros((self.nCh,self.nHeis)) |
|
4015 | self.n_radar = numpy.zeros((self.nCh,self.nHeis)) | |
4014 | self.Z_radar = numpy.zeros((self.nCh,self.nHeis)) |
|
4016 | self.Z_radar = numpy.zeros((self.nCh,self.nHeis)) | |
4015 | for R in range(self.nHeis): |
|
4017 | for R in range(self.nHeis): | |
4016 | self.n_radar[:,R] = self.RadarConstant*Pr[:,R]* (self.Range[:,R])**2 |
|
4018 | self.n_radar[:,R] = self.RadarConstant*Pr[:,R]* (self.Range[:,R])**2*(10**-10.246) | |
4017 |
|
4019 | |||
4018 | self.Z_radar[:,R] = self.n_radar[:,R]* self.lambda_**4/( numpy.pi**5 * self.Km**2) |
|
4020 | self.Z_radar[:,R] = self.n_radar[:,R]* self.lambda_**4/( numpy.pi**5 * self.Km**2) | |
4019 |
|
4021 | |||
@@ -4035,8 +4037,8 class WeatherRadar(Operation): | |||||
4035 | return Sigmav_W |
|
4037 | return Sigmav_W | |
4036 |
|
4038 | |||
4037 |
|
4039 | |||
4038 |
def run(self,dataOut,variableList=variableList,Pt= |
|
4040 | def run(self,dataOut,variableList=variableList,Pt=1.58,Gt=38.5,Gr=38.5,Glna=70.0,lambda_=0.032, aL=1, | |
4039 |
tauW= 0.2 |
|
4041 | tauW= 0.2,thetaT=0.0314,thetaR=0.0314,Km =0.93): | |
4040 |
|
4042 | |||
4041 | if not self.isConfig: |
|
4043 | if not self.isConfig: | |
4042 | self.setup(dataOut= dataOut,variableList=variableList,Pt=Pt,Gt=Gt,Gr=Gr,Glna=Glna,lambda_=lambda_, aL=aL, |
|
4044 | self.setup(dataOut= dataOut,variableList=variableList,Pt=Pt,Gt=Gt,Gr=Gr,Glna=Glna,lambda_=lambda_, aL=aL, | |
@@ -4045,7 +4047,6 class WeatherRadar(Operation): | |||||
4045 | for i in range(len(self.variableList)): |
|
4047 | for i in range(len(self.variableList)): | |
4046 | if self.variableList[i]=='Reflectividad': |
|
4048 | if self.variableList[i]=='Reflectividad': | |
4047 | dataOut.Zdb =self.getReflectividad_D(dataOut=dataOut,type='N') |
|
4049 | dataOut.Zdb =self.getReflectividad_D(dataOut=dataOut,type='N') | |
4048 | print(dataOut.Zdb) |
|
|||
4049 | if self.variableList[i]=='ReflectividadDiferencial': |
|
4050 | if self.variableList[i]=='ReflectividadDiferencial': | |
4050 | dataOut.Zdb_D =self.getReflectividad_D(dataOut=dataOut,type='D') |
|
4051 | dataOut.Zdb_D =self.getReflectividad_D(dataOut=dataOut,type='D') | |
4051 | if self.variableList[i]=='FaseDiferencial': |
|
4052 | if self.variableList[i]=='FaseDiferencial': | |
@@ -4116,14 +4117,76 class PedestalInformation(Operation): | |||||
4116 | log.error('No new position files found in {}'.format(path)) |
|
4117 | log.error('No new position files found in {}'.format(path)) | |
4117 | raise IOError('No new position files found in {}'.format(path)) |
|
4118 | raise IOError('No new position files found in {}'.format(path)) | |
4118 |
|
4119 | |||
|
4120 | def find_mode(self,index): | |||
|
4121 | sample_max = 20 | |||
|
4122 | start = index | |||
|
4123 | flag_mode = None | |||
|
4124 | azi = self.fp['Data']['azi_pos'][:] | |||
|
4125 | ele = self.fp['Data']['ele_pos'][:] | |||
|
4126 | #print("az: ",az) | |||
|
4127 | #exit(1) | |||
|
4128 | while True: | |||
|
4129 | if start+sample_max > numpy.shape(ele)[0]: | |||
|
4130 | print("CANNOT KNOW IF MODE IS PPI OR RHI, ANALIZE NEXT FILE") | |||
|
4131 | print("ele",ele[start-sample_max:start+sample_max]) | |||
|
4132 | print("azi",ele[start-sample_max:start+sample_max]) | |||
|
4133 | if sample_max == 10: | |||
|
4134 | break | |||
|
4135 | else: | |||
|
4136 | sample_max = 10 | |||
|
4137 | continue | |||
|
4138 | sigma_ele = numpy.nanstd(ele[start:start+sample_max]) | |||
|
4139 | sigma_azi = numpy.nanstd(azi[start:start+sample_max]) | |||
|
4140 | print("Start",start) | |||
|
4141 | print("ele",ele[start:start+sample_max]) | |||
|
4142 | print("s_ele",sigma_ele) | |||
|
4143 | print("azi",azi[start:start+sample_max]) | |||
|
4144 | print("s_azi",sigma_azi) | |||
|
4145 | #print(start) | |||
|
4146 | if sigma_ele<.5 and sigma_azi<.5: | |||
|
4147 | if sigma_ele<sigma_azi: | |||
|
4148 | flag_mode = 'PPI' | |||
|
4149 | break | |||
|
4150 | else: | |||
|
4151 | flag_mode = 'RHI' | |||
|
4152 | break | |||
|
4153 | elif sigma_ele<.5: | |||
|
4154 | #print(sigma_ele) | |||
|
4155 | #print(round(numpy.nanmean(ele[start:start+sample_max]),1)) | |||
|
4156 | #print(start) | |||
|
4157 | #print(ele[start:start+sample_max]) | |||
|
4158 | flag_mode = 'PPI' | |||
|
4159 | break | |||
|
4160 | elif sigma_azi<.5: | |||
|
4161 | #print(sigma_azi) | |||
|
4162 | #print(azi[start:start+sample_max]) | |||
|
4163 | #print("round",round(numpy.nanmean(azi[start:start+sample_max]),1)) | |||
|
4164 | flag_mode = 'RHI' | |||
|
4165 | break | |||
|
4166 | #else: | |||
|
4167 | #print("STD mayor que .5") | |||
|
4168 | start += sample_max | |||
|
4169 | print("MODE: ",flag_mode) | |||
|
4170 | return flag_mode | |||
4119 |
|
4171 | |||
4120 | def get_values(self): |
|
4172 | def get_values(self): | |
4121 |
|
4173 | |||
4122 | if self.flagNoData: |
|
4174 | if self.flagNoData: | |
4123 | return numpy.nan, numpy.nan |
|
4175 | print("get_value_1") | |
|
4176 | return numpy.nan, numpy.nan, numpy.nan #Should be self.mode? | |||
4124 | else: |
|
4177 | else: | |
4125 | index = int((self.utctime-self.utcfile)/self.interval) |
|
4178 | index = int((self.utctime-self.utcfile)/self.interval) | |
4126 | return self.fp['Data']['azi_pos'][index], self.fp['Data']['ele_pos'][index] |
|
4179 | ||
|
4180 | if self.flagAskMode: | |||
|
4181 | mode = self.find_mode(index) | |||
|
4182 | else: | |||
|
4183 | mode = self.mode | |||
|
4184 | ||||
|
4185 | if mode is not None: | |||
|
4186 | return self.fp['Data']['azi_pos'][index], self.fp['Data']['ele_pos'][index], mode | |||
|
4187 | else: | |||
|
4188 | print("get_value_2") | |||
|
4189 | return numpy.nan, numpy.nan, numpy.nan | |||
4127 |
|
4190 | |||
4128 | def setup(self, dataOut, path, conf, samples, interval, az_offset): |
|
4191 | def setup(self, dataOut, path, conf, samples, interval, az_offset): | |
4129 |
|
4192 | |||
@@ -4146,23 +4209,33 class PedestalInformation(Operation): | |||||
4146 |
|
4209 | |||
4147 | if not self.isConfig: |
|
4210 | if not self.isConfig: | |
4148 | self.setup(dataOut, path, conf, samples, interval, az_offset) |
|
4211 | self.setup(dataOut, path, conf, samples, interval, az_offset) | |
|
4212 | #self.flagAskMode = True | |||
4149 | self.isConfig = True |
|
4213 | self.isConfig = True | |
4150 |
|
4214 | |||
4151 | self.utctime = dataOut.utctime + time_offset |
|
4215 | self.utctime = dataOut.utctime + time_offset | |
4152 |
|
4216 | |||
|
4217 | if hasattr(dataOut, 'flagAskMode'): | |||
|
4218 | self.flagAskMode = dataOut.flagAskMode | |||
|
4219 | #print("inside",self.flagAskMode) | |||
|
4220 | else: | |||
|
4221 | #print("nooooooo") | |||
|
4222 | self.flagAskMode = True | |||
|
4223 | ||||
4153 | self.find_next_file() |
|
4224 | self.find_next_file() | |
4154 |
|
4225 | |||
4155 | az, el = self.get_values() |
|
4226 | az, el, self.mode = self.get_values() | |
|
4227 | print("after get_values",az,el,self.mode) | |||
4156 | dataOut.flagNoData = False |
|
4228 | dataOut.flagNoData = False | |
4157 |
|
||||
4158 | if numpy.isnan(az) or numpy.isnan(el) : |
|
4229 | if numpy.isnan(az) or numpy.isnan(el) : | |
4159 | dataOut.flagNoData = True |
|
4230 | dataOut.flagNoData = True | |
|
4231 | #print("NAN") | |||
4160 | return dataOut |
|
4232 | return dataOut | |
4161 |
|
4233 | |||
4162 | dataOut.azimuth = az - az_offset |
|
4234 | dataOut.azimuth = az - az_offset | |
4163 | if dataOut.azimuth < 0: |
|
4235 | if dataOut.azimuth < 0: | |
4164 | dataOut.azimuth += 360 |
|
4236 | dataOut.azimuth += 360 | |
4165 | dataOut.elevation = el |
|
4237 | dataOut.elevation = el | |
|
4238 | dataOut.mode_op = self.mode[:] | |||
4166 |
|
4239 | |||
4167 | return dataOut |
|
4240 | return dataOut | |
4168 |
|
4241 | |||
@@ -4926,7 +4999,7 class Block360_vRF4(Operation): | |||||
4926 | data_e = None |
|
4999 | data_e = None | |
4927 |
|
5000 | |||
4928 | angles = self.putData(data=dataOut, attr = self.attr, flagMode=flagMode) |
|
5001 | angles = self.putData(data=dataOut, attr = self.attr, flagMode=flagMode) | |
4929 | #print(angles) |
|
5002 | #print("ANGLES",angles) | |
4930 | if self.__profIndex > 1: |
|
5003 | if self.__profIndex > 1: | |
4931 | case_flag = self.checkcase(angles,flagMode) |
|
5004 | case_flag = self.checkcase(angles,flagMode) | |
4932 |
|
5005 | |||
@@ -4993,12 +5066,17 class Block360_vRF4(Operation): | |||||
4993 | if diff_angle > 0: #Subida |
|
5066 | if diff_angle > 0: #Subida | |
4994 | return 0 |
|
5067 | return 0 | |
4995 |
|
5068 | |||
4996 |
def run(self, dataOut, attr_data='dataPP_POWER', |
|
5069 | def run(self, dataOut, attr_data='dataPP_POWER', runNextOp = False,**kwargs): | |
4997 |
|
5070 | |||
4998 | dataOut.attr_data = attr_data |
|
5071 | dataOut.attr_data = attr_data | |
4999 | dataOut.runNextOp = runNextOp |
|
5072 | dataOut.runNextOp = runNextOp | |
5000 |
|
5073 | dataOut.flagAskMode = False | ||
5001 | dataOut.flagMode = axis[0] #Provisional, debería venir del header |
|
5074 | #print("Block 360") | |
|
5075 | #dataOut.flagMode = axis[0] #Provisional, debería venir del header | |||
|
5076 | if dataOut.mode_op == 'PPI': | |||
|
5077 | dataOut.flagMode = 1 | |||
|
5078 | elif dataOut.mode_op == 'RHI': | |||
|
5079 | dataOut.flagMode = 0 | |||
5002 |
|
5080 | |||
5003 | if not self.isConfig: |
|
5081 | if not self.isConfig: | |
5004 | self.setup(dataOut = dataOut, attr = attr_data ,**kwargs) |
|
5082 | self.setup(dataOut = dataOut, attr = attr_data ,**kwargs) | |
@@ -5014,6 +5092,9 class Block360_vRF4(Operation): | |||||
5014 | dataOut.data_ele = data_e |
|
5092 | dataOut.data_ele = data_e | |
5015 | dataOut.utctime = avgdatatime |
|
5093 | dataOut.utctime = avgdatatime | |
5016 | dataOut.flagNoData = False |
|
5094 | dataOut.flagNoData = False | |
|
5095 | dataOut.flagAskMode = True | |||
|
5096 | print("AZI: ",dataOut.data_azi) | |||
|
5097 | print("ELE: ",dataOut.data_ele) | |||
5017 | #print("********************attr_data********************",attr_data) |
|
5098 | #print("********************attr_data********************",attr_data) | |
5018 | #print(data_360.shape) |
|
5099 | #print(data_360.shape) | |
5019 | #print(dataOut.heightList) |
|
5100 | #print(dataOut.heightList) |
@@ -7,12 +7,12 PATH = '/DATA_RM/DATA' | |||||
7 | # PATH = '/Users/jespinoza/workspace/data/' |
|
7 | # PATH = '/Users/jespinoza/workspace/data/' | |
8 |
|
8 | |||
9 | PARAM = { |
|
9 | PARAM = { | |
10 |
'P': {'name': 'dataPP_POWER', 'zmin': 35, 'zmax': 60, 'colormap': ' |
|
10 | 'P': {'name': 'dataPP_POWER', 'zmin': 35, 'zmax': 60, 'colormap': 'jet', 'label': 'Power', 'cb_label': 'dB'}, | |
11 | 'V': {'name': 'dataPP_DOP', 'zmin': -20, 'zmax': 20, 'colormap': 'seismic', 'label': 'Velocity', 'cb_label': 'm/s'}, |
|
11 | 'V': {'name': 'dataPP_DOP', 'zmin': -20, 'zmax': 20, 'colormap': 'seismic', 'label': 'Velocity', 'cb_label': 'm/s'}, | |
12 | 'RH': {'name': 'RhoHV_R', 'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'CoeficienteCorrelacion', 'cb_label': '*'}, |
|
12 | 'RH': {'name': 'RhoHV_R', 'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'CoeficienteCorrelacion', 'cb_label': '*'}, | |
13 | 'FD': {'name': 'PhiD_P', 'zmin': -180, 'zmax': 180, 'colormap': 'RdBu_r', 'label': 'Fase Diferencial', 'cb_label': 'º'}, |
|
13 | 'FD': {'name': 'PhiD_P', 'zmin': -180, 'zmax': 180, 'colormap': 'RdBu_r', 'label': 'Fase Diferencial', 'cb_label': 'º'}, | |
14 | 'ZD': {'name': 'Zdb_D', 'zmin': -20, 'zmax': 80, 'colormap': 'viridis', 'label': 'ReflectividadDiferencial', 'cb_label': 'dB'}, |
|
14 | 'ZD': {'name': 'Zdb_D', 'zmin': -20, 'zmax': 80, 'colormap': 'viridis', 'label': 'ReflectividadDiferencial', 'cb_label': 'dB'}, | |
15 |
'Z': {'name': 'Zdb', 'zmin': |
|
15 | 'Z': {'name': 'Zdb', 'zmin': -20, 'zmax': 60, 'colormap': 'viridis', 'label': 'Reflectividad', 'cb_label': 'dB'}, | |
16 | 'W': {'name': 'Sigmav_W', 'zmin': -20, 'zmax': 60, 'colormap': 'viridis', 'label': 'AnchoEspectral', 'cb_label': 'hz'} |
|
16 | 'W': {'name': 'Sigmav_W', 'zmin': -20, 'zmax': 60, 'colormap': 'viridis', 'label': 'AnchoEspectral', 'cb_label': 'hz'} | |
17 | } |
|
17 | } | |
18 | #Z,ZD 'mm^6/m^3' |
|
18 | #Z,ZD 'mm^6/m^3' |
General Comments 0
You need to be logged in to leave comments.
Login now