##// END OF EJS Templates
Reading Unit for Madrigal decorated (just for python2X)
George Yong -
r1189:67ce1e63c533
parent child
Show More
@@ -15,7 +15,7 import numpy
15 import h5py
15 import h5py
16
16
17 from schainpy.model.io.jroIO_base import JRODataReader
17 from schainpy.model.io.jroIO_base import JRODataReader
18 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation
18 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator
19 from schainpy.model.data.jrodata import Parameters
19 from schainpy.model.data.jrodata import Parameters
20 from schainpy.utils import log
20 from schainpy.utils import log
21
21
@@ -70,12 +70,12 def load_json(obj):
70
70
71 return iterable
71 return iterable
72
72
73
73 @MPDecorator
74 class MADReader(JRODataReader, ProcessingUnit):
74 class MADReader(JRODataReader, ProcessingUnit):
75
75
76 def __init__(self, **kwargs):
76 def __init__(self):
77
77
78 ProcessingUnit.__init__(self, **kwargs)
78 ProcessingUnit.__init__(self)
79
79
80 self.dataOut = Parameters()
80 self.dataOut = Parameters()
81 self.counter_records = 0
81 self.counter_records = 0
@@ -495,7 +495,7 class MADWriter(Operation):
495 self.ext)
495 self.ext)
496
496
497 self.fullname = os.path.join(self.path, filename)
497 self.fullname = os.path.join(self.path, filename)
498
498
499 if os.path.isfile(self.fullname) :
499 if os.path.isfile(self.fullname) :
500 log.warning(
500 log.warning(
501 'Destination file {} already exists, previous file deleted.'.format(
501 'Destination file {} already exists, previous file deleted.'.format(
@@ -554,7 +554,7 class MADWriter(Operation):
554 attr, x = value
554 attr, x = value
555 data = getattr(self.dataOut, attr)
555 data = getattr(self.dataOut, attr)
556 out[key] = data[int(x)]
556 out[key] = data[int(x)]
557
557
558 a = numpy.array([out[k] for k in self.keys])
558 a = numpy.array([out[k] for k in self.keys])
559 nrows = numpy.array([numpy.isnan(a[:, x]).all() for x in range(len(heights))])
559 nrows = numpy.array([numpy.isnan(a[:, x]).all() for x in range(len(heights))])
560 index = numpy.where(nrows == False)[0]
560 index = numpy.where(nrows == False)[0]
General Comments 0
You need to be logged in to leave comments. Login now