##// 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 15 import h5py
16 16
17 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 19 from schainpy.model.data.jrodata import Parameters
20 20 from schainpy.utils import log
21 21
@@ -70,12 +70,12 def load_json(obj):
70 70
71 71 return iterable
72 72
73
73 @MPDecorator
74 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 80 self.dataOut = Parameters()
81 81 self.counter_records = 0
@@ -495,7 +495,7 class MADWriter(Operation):
495 495 self.ext)
496 496
497 497 self.fullname = os.path.join(self.path, filename)
498
498
499 499 if os.path.isfile(self.fullname) :
500 500 log.warning(
501 501 'Destination file {} already exists, previous file deleted.'.format(
@@ -554,7 +554,7 class MADWriter(Operation):
554 554 attr, x = value
555 555 data = getattr(self.dataOut, attr)
556 556 out[key] = data[int(x)]
557
557
558 558 a = numpy.array([out[k] for k in self.keys])
559 559 nrows = numpy.array([numpy.isnan(a[:, x]).all() for x in range(len(heights))])
560 560 index = numpy.where(nrows == False)[0]
General Comments 0
You need to be logged in to leave comments. Login now