@@ -172,8 +172,7 class GenericRTIPlot(Plot): | |||||
172 |
|
172 | |||
173 | self.ylabel = 'Height [km]' |
|
173 | self.ylabel = 'Height [km]' | |
174 | if not self.titles: |
|
174 | if not self.titles: | |
175 | self.titles = self.data.parameters \ |
|
175 | self.titles = ['Param {}'.format(x) for x in range(self.nrows)] | |
176 | if self.data.parameters else ['Param {}'.format(x) for x in range(self.nrows)] |
|
|||
177 |
|
176 | |||
178 | def update(self, dataOut): |
|
177 | def update(self, dataOut): | |
179 |
|
178 |
@@ -1,16 +1,8 | |||||
1 | import os |
|
1 | import os | |
2 | import sys |
|
2 | import sys | |
3 | import glob |
|
3 | import glob | |
4 | import fnmatch |
|
|||
5 | import datetime |
|
|||
6 | import time |
|
|||
7 | import re |
|
|||
8 | import h5py |
|
|||
9 | import numpy |
|
4 | import numpy | |
10 |
|
5 | |||
11 | import pylab as plb |
|
|||
12 | from scipy.optimize import curve_fit |
|
|||
13 | from scipy import asarray as ar, exp |
|
|||
14 |
|
6 | |||
15 | SPEED_OF_LIGHT = 299792458 |
|
7 | SPEED_OF_LIGHT = 299792458 | |
16 | SPEED_OF_LIGHT = 3e8 |
|
8 | SPEED_OF_LIGHT = 3e8 | |
@@ -19,9 +11,9 from .utils import folder_in_range | |||||
19 |
|
11 | |||
20 | import schainpy.admin |
|
12 | import schainpy.admin | |
21 | from schainpy.model.data.jrodata import Spectra |
|
13 | from schainpy.model.data.jrodata import Spectra | |
22 |
from schainpy.model.proc.jroproc_base import ProcessingUnit |
|
14 | from schainpy.model.proc.jroproc_base import ProcessingUnit | |
23 | from schainpy.utils import log |
|
15 | from schainpy.utils import log | |
24 | from schainpy.model.io.jroIO_base import JRODataReader |
|
16 | ||
25 |
|
17 | |||
26 | def pol2cart(rho, phi): |
|
18 | def pol2cart(rho, phi): | |
27 | x = rho * numpy.cos(phi) |
|
19 | x = rho * numpy.cos(phi) | |
@@ -423,7 +415,6 class BLTRSpectraReader (ProcessingUnit): | |||||
423 | copy = self.data_block.copy() |
|
415 | copy = self.data_block.copy() | |
424 | spc = copy * numpy.conjugate(copy) |
|
416 | spc = copy * numpy.conjugate(copy) | |
425 | self.data_spc = numpy.absolute(spc) # valor absoluto o magnitud |
|
417 | self.data_spc = numpy.absolute(spc) # valor absoluto o magnitud | |
426 | self.dataOut.data_spc = self.data_spc |
|
|||
427 |
|
418 | |||
428 | cspc = self.data_block.copy() |
|
419 | cspc = self.data_block.copy() | |
429 | self.data_cspc = self.data_block.copy() |
|
420 | self.data_cspc = self.data_block.copy() |
@@ -196,11 +196,11 class HDFReader(Reader, ProcessingUnit): | |||||
196 |
|
196 | |||
197 | if self.description: |
|
197 | if self.description: | |
198 | for key, value in self.description['Metadata'].items(): |
|
198 | for key, value in self.description['Metadata'].items(): | |
199 |
meta[key] = self.fp[value] |
|
199 | meta[key] = self.fp[value][()] | |
200 | else: |
|
200 | else: | |
201 | grp = self.fp['Metadata'] |
|
201 | grp = self.fp['Metadata'] | |
202 | for name in grp: |
|
202 | for name in grp: | |
203 |
meta[name] = grp[name] |
|
203 | meta[name] = grp[name][()] | |
204 |
|
204 | |||
205 | if self.extras: |
|
205 | if self.extras: | |
206 | for key, value in self.extras.items(): |
|
206 | for key, value in self.extras.items(): | |
@@ -217,26 +217,26 class HDFReader(Reader, ProcessingUnit): | |||||
217 | for key, value in self.description['Data'].items(): |
|
217 | for key, value in self.description['Data'].items(): | |
218 | if isinstance(value, str): |
|
218 | if isinstance(value, str): | |
219 | if isinstance(self.fp[value], h5py.Dataset): |
|
219 | if isinstance(self.fp[value], h5py.Dataset): | |
220 |
data[key] = self.fp[value] |
|
220 | data[key] = self.fp[value][()] | |
221 | elif isinstance(self.fp[value], h5py.Group): |
|
221 | elif isinstance(self.fp[value], h5py.Group): | |
222 | array = [] |
|
222 | array = [] | |
223 | for ch in self.fp[value]: |
|
223 | for ch in self.fp[value]: | |
224 |
array.append(self.fp[value][ch] |
|
224 | array.append(self.fp[value][ch][()]) | |
225 | data[key] = numpy.array(array) |
|
225 | data[key] = numpy.array(array) | |
226 | elif isinstance(value, list): |
|
226 | elif isinstance(value, list): | |
227 | array = [] |
|
227 | array = [] | |
228 | for ch in value: |
|
228 | for ch in value: | |
229 |
array.append(self.fp[ch] |
|
229 | array.append(self.fp[ch][()]) | |
230 | data[key] = numpy.array(array) |
|
230 | data[key] = numpy.array(array) | |
231 | else: |
|
231 | else: | |
232 | grp = self.fp['Data'] |
|
232 | grp = self.fp['Data'] | |
233 | for name in grp: |
|
233 | for name in grp: | |
234 | if isinstance(grp[name], h5py.Dataset): |
|
234 | if isinstance(grp[name], h5py.Dataset): | |
235 |
array = grp[name] |
|
235 | array = grp[name][()] | |
236 | elif isinstance(grp[name], h5py.Group): |
|
236 | elif isinstance(grp[name], h5py.Group): | |
237 | array = [] |
|
237 | array = [] | |
238 | for ch in grp[name]: |
|
238 | for ch in grp[name]: | |
239 |
array.append(grp[name][ch] |
|
239 | array.append(grp[name][ch][()]) | |
240 | array = numpy.array(array) |
|
240 | array = numpy.array(array) | |
241 | else: |
|
241 | else: | |
242 | log.warning('Unknown type: {}'.format(name)) |
|
242 | log.warning('Unknown type: {}'.format(name)) |
@@ -5,14 +5,10 Created on Oct 24, 2016 | |||||
5 | ''' |
|
5 | ''' | |
6 |
|
6 | |||
7 | import numpy |
|
7 | import numpy | |
8 | import copy |
|
|||
9 | import datetime |
|
8 | import datetime | |
10 | import time |
|
9 | import time | |
11 | from time import gmtime |
|
|||
12 |
|
10 | |||
13 | from numpy import transpose |
|
11 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation | |
14 |
|
||||
15 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator |
|
|||
16 | from schainpy.model.data.jrodata import Parameters |
|
12 | from schainpy.model.data.jrodata import Parameters | |
17 |
|
13 | |||
18 |
|
14 | |||
@@ -68,10 +64,11 class BLTRParametersProc(ProcessingUnit): | |||||
68 | self.dataOut.data_param = self.dataOut.data[mode] |
|
64 | self.dataOut.data_param = self.dataOut.data[mode] | |
69 | self.dataOut.heightList = self.dataOut.height[0] |
|
65 | self.dataOut.heightList = self.dataOut.height[0] | |
70 | self.dataOut.data_snr = self.dataOut.data_snr[mode] |
|
66 | self.dataOut.data_snr = self.dataOut.data_snr[mode] | |
|
67 | SNRavg = numpy.average(self.dataOut.data_snr, axis=0) | |||
|
68 | SNRavgdB = 10*numpy.log10(SNRavg) | |||
|
69 | self.dataOut.data_snr_avg_db = SNRavgdB.reshape(1, *SNRavgdB.shape) | |||
71 |
|
70 | |||
72 | if snr_threshold is not None: |
|
71 | if snr_threshold is not None: | |
73 | SNRavg = numpy.average(self.dataOut.data_snr, axis=0) |
|
|||
74 | SNRavgdB = 10*numpy.log10(SNRavg) |
|
|||
75 | for i in range(3): |
|
72 | for i in range(3): | |
76 | self.dataOut.data_param[i][SNRavgdB <= snr_threshold] = numpy.nan |
|
73 | self.dataOut.data_param[i][SNRavgdB <= snr_threshold] = numpy.nan | |
77 |
|
74 |
General Comments 0
You need to be logged in to leave comments.
Login now