##// END OF EJS Templates
Filtering AMISR files for Datetime Range...
Filtering AMISR files for Datetime Range New Attributes for AMISR and JROData: azimuth, zenith Azimuth and Zenith is printed in RTI and Spectra plots

File last commit:

r499:f28411fcbfa0
r499:f28411fcbfa0
Show More
jroproc_amisr.py
90 lines | 2.5 KiB | text/x-python | PythonLexer
Daniel Valdez
AMISR modules to read hdf5 files and link to SignalChain Objects...
r491 '''
@author: Daniel Suarez
'''
from jroproc_base import ProcessingUnit, Operation
from model.data.jroamisr import AMISR
class AMISRProc(ProcessingUnit):
def __init__(self):
ProcessingUnit.__init__(self)
self.objectDict = {}
self.dataOut = AMISR()
def run(self):
if self.dataIn.type == 'AMISR':
self.dataOut.copy(self.dataIn)
class PrintInfo(Operation):
def __init__(self):
Daniel Valdez
Bug fixed: AMISR Reader filling with zeros at the begining of the processing....
r497 self.__isPrinted = False
Daniel Valdez
AMISR modules to read hdf5 files and link to SignalChain Objects...
r491
def run(self, dataOut):
Daniel Valdez
Bug fixed: AMISR Reader filling with zeros at the begining of the processing....
r497 if not self.__isPrinted:
print 'Number of Records by File: %d'%dataOut.nRecords
print 'Number of Pulses: %d'%dataOut.nProfiles
print 'Number of Pulses by Frame: %d'%dataOut.npulseByFrame
print 'Number of Samples by Pulse: %d'%len(dataOut.heightList)
print 'Ipp Seconds: %f'%dataOut.ippSeconds
print 'Number of Beams: %d'%dataOut.nBeams
print 'BeamCodes:'
Daniel Valdez
Filtering AMISR files for Datetime Range...
r499 beamStrList = ['Beam %d -> Code=%d, azimuth=%2.2f, zenith=%2.2f, gain=%2.2f'%(k,v[0],v[1],v[2],v[3]) for k,v in dataOut.beamCodeDict.items()]
Daniel Valdez
Bug fixed: AMISR Reader filling with zeros at the begining of the processing....
r497 for b in beamStrList:
print b
self.__isPrinted = True
return
Daniel Valdez
AMISR modules to read hdf5 files and link to SignalChain Objects...
r491
class BeamSelector(Operation):
profileIndex = None
nProfiles = None
def __init__(self):
self.profileIndex = 0
def incIndex(self):
self.profileIndex += 1
if self.profileIndex >= self.nProfiles:
self.profileIndex = 0
def isProfileInRange(self, minIndex, maxIndex):
if self.profileIndex < minIndex:
return False
if self.profileIndex > maxIndex:
return False
return True
def isProfileInList(self, profileList):
if self.profileIndex not in profileList:
return False
return True
def run(self, dataOut, beam=None):
dataOut.flagNoData = True
self.nProfiles = dataOut.nProfiles
if beam != None:
if self.isProfileInList(dataOut.beamRangeDict[beam]):
Daniel Valdez
Filtering AMISR files for Datetime Range...
r499 beamInfo = dataOut.beamCodeDict[beam]
dataOut.azimuth = beamInfo[1]
dataOut.zenith = beamInfo[2]
dataOut.gain = beamInfo[3]
Daniel Valdez
AMISR modules to read hdf5 files and link to SignalChain Objects...
r491 dataOut.flagNoData = False
self.incIndex()
return 1
else:
raise ValueError, "BeamSelector needs beam value"
return 0