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