@@ -44,7 +44,11 class AMISR: | |||
|
44 | 44 | #consideracion para los Beams |
|
45 | 45 | self.beamCodeDict = None |
|
46 | 46 | self.beamRangeDict = None |
|
47 | ||
|
47 | self.beamcode = None | |
|
48 | self.azimuth = None | |
|
49 | self.zenith = None | |
|
50 | self.gain = None | |
|
51 | ||
|
48 | 52 | self.npulseByFrame = None |
|
49 | 53 | |
|
50 | 54 | def copy(self, inputObj=None): |
@@ -189,6 +189,10 class JROData(GenericData): | |||
|
189 | 189 | |
|
190 | 190 | blocknow = None |
|
191 | 191 | |
|
192 | azimuth = None | |
|
193 | ||
|
194 | zenith = None | |
|
195 | ||
|
192 | 196 | def __init__(self): |
|
193 | 197 | |
|
194 | 198 | raise ValueError, "This class has not been implemented" |
@@ -131,6 +131,9 class SpectraPlot(Figure): | |||
|
131 | 131 | #thisDatetime = dataOut.datatime |
|
132 | 132 | thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1]) |
|
133 | 133 | title = wintitle + " Spectra" |
|
134 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
|
135 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) | |
|
136 | ||
|
134 | 137 | xlabel = "Velocity (m/s)" |
|
135 | 138 | ylabel = "Range (Km)" |
|
136 | 139 | |
@@ -185,7 +188,10 class SpectraPlot(Figure): | |||
|
185 | 188 | if figfile == None: |
|
186 | 189 | str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
187 | 190 | figfile = self.getFilename(name = str_datetime) |
|
188 | ||
|
191 | name = str_datetime | |
|
192 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
|
193 | name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith) | |
|
194 | figfile = self.getFilename(name) | |
|
189 | 195 | if figpath != '': |
|
190 | 196 | self.counter_imagwr += 1 |
|
191 | 197 | if (self.counter_imagwr>=wr_period): |
@@ -563,6 +569,8 class RTIPlot(Figure): | |||
|
563 | 569 | |
|
564 | 570 | for i in range(self.nplots): |
|
565 | 571 | title = "Channel %d: %s" %(dataOut.channelList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) |
|
572 | if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)): | |
|
573 | title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith) | |
|
566 | 574 | axes = self.axesList[i*self.__nsubplots] |
|
567 | 575 | zdB = avgdB[i].reshape((1,-1)) |
|
568 | 576 | axes.pcolorbuffer(x, y, zdB, |
@@ -173,7 +173,37 class AMISRReader(ProcessingUnit): | |||
|
173 | 173 | return None |
|
174 | 174 | |
|
175 | 175 | def __getTimeFromData(self): |
|
176 | pass | |
|
176 | startDateTime_Reader = datetime.datetime.combine(self.startDate,self.startTime) | |
|
177 | endDateTime_Reader = datetime.datetime.combine(self.endDate,self.endTime) | |
|
178 | ||
|
179 | print 'Filtering Files from %s to %s'%(startDateTime_Reader, endDateTime_Reader) | |
|
180 | print '........................................' | |
|
181 | filter_filenameList = [] | |
|
182 | for filename in self.filenameList: | |
|
183 | fp = h5py.File(filename,'r') | |
|
184 | time_str = fp.get('Time/RadacTimeString') | |
|
185 | ||
|
186 | startDateTimeStr_File = time_str[0][0].split('.')[0] | |
|
187 | junk = time.strptime(startDateTimeStr_File, '%Y-%m-%d %H:%M:%S') | |
|
188 | startDateTime_File = datetime.datetime(junk.tm_year,junk.tm_mon,junk.tm_mday,junk.tm_hour, junk.tm_min, junk.tm_sec) | |
|
189 | ||
|
190 | endDateTimeStr_File = time_str[-1][-1].split('.')[0] | |
|
191 | junk = time.strptime(endDateTimeStr_File, '%Y-%m-%d %H:%M:%S') | |
|
192 | endDateTime_File = datetime.datetime(junk.tm_year,junk.tm_mon,junk.tm_mday,junk.tm_hour, junk.tm_min, junk.tm_sec) | |
|
193 | ||
|
194 | fp.close() | |
|
195 | ||
|
196 | if self.timezone == 'lt': | |
|
197 | startDateTime_File = startDateTime_File - datetime.timedelta(minutes = 300) | |
|
198 | endDateTime_File = endDateTime_File - datetime.timedelta(minutes = 300) | |
|
199 | ||
|
200 | if (endDateTime_File>=startDateTime_Reader and endDateTime_File<endDateTime_Reader): | |
|
201 | #self.filenameList.remove(filename) | |
|
202 | filter_filenameList.append(filename) | |
|
203 | ||
|
204 | filter_filenameList.sort() | |
|
205 | self.filenameList = filter_filenameList | |
|
206 | return 1 | |
|
177 | 207 | |
|
178 | 208 | def __filterByGlob1(self, dirName): |
|
179 | 209 | filter_files = glob.glob1(dirName, '*.*%s'%self.extension_file) |
@@ -200,7 +230,11 class AMISRReader(ProcessingUnit): | |||
|
200 | 230 | fileListInKeys = [self.__filterByGlob1(x) for x in dirList] |
|
201 | 231 | |
|
202 | 232 | self.__getFilenameList(fileListInKeys, dirList) |
|
203 | ||
|
233 | #filtro por tiempo | |
|
234 | if not(self.all): | |
|
235 | self.__getTimeFromData() | |
|
236 | ||
|
237 | ||
|
204 | 238 | if len(self.filenameList)>0: |
|
205 | 239 | self.status = 1 |
|
206 | 240 | self.filenameList.sort() |
@@ -290,16 +324,22 class AMISRReader(ProcessingUnit): | |||
|
290 | 324 | self.beamCodeDict = {} |
|
291 | 325 | self.beamRangeDict = {} |
|
292 | 326 | |
|
327 | beamCodeMap = self.amisrFilePointer.get('Setup/BeamcodeMap') | |
|
328 | ||
|
293 | 329 | for i in range(len(self.radacHeaderObj.beamCode[0,:])): |
|
294 | 330 | self.beamCodeDict.setdefault(i) |
|
295 | 331 | self.beamRangeDict.setdefault(i) |
|
296 |
|
|
|
332 | beamcodeValue = self.radacHeaderObj.beamCode[0,i] | |
|
333 | beamcodeIndex = numpy.where(beamCodeMap[:,0] == beamcodeValue)[0][0] | |
|
334 | x = beamCodeMap[beamcodeIndex][1] | |
|
335 | y = beamCodeMap[beamcodeIndex][2] | |
|
336 | z = beamCodeMap[beamcodeIndex][3] | |
|
337 | self.beamCodeDict[i] = [beamcodeValue, x, y, z] | |
|
297 | 338 | |
|
298 | ||
|
299 | 339 | just4record0 = self.radacHeaderObj.beamCodeByPulse[0,:] |
|
300 | 340 | |
|
301 | 341 | for i in range(len(self.beamCodeDict.values())): |
|
302 | xx = numpy.where(just4record0==self.beamCodeDict.values()[i]) | |
|
342 | xx = numpy.where(just4record0==self.beamCodeDict.values()[i][0]) | |
|
303 | 343 | self.beamRangeDict[i] = xx[0] |
|
304 | 344 | |
|
305 | 345 | def __getExpParameters(self): |
@@ -332,6 +372,7 class AMISRReader(ProcessingUnit): | |||
|
332 | 372 | |
|
333 | 373 | tufileFinder = fnmatch.filter(lines, 'tufile=*') |
|
334 | 374 | tufile = tufileFinder[0].split('=')[1].split('\n')[0] |
|
375 | tufile = tufile.split('\r')[0] | |
|
335 | 376 | tufilename = os.path.join(experimentCfgPath,tufile) |
|
336 | 377 | |
|
337 | 378 | f = open(tufilename) |
@@ -374,9 +415,11 class AMISRReader(ProcessingUnit): | |||
|
374 | 415 | startTime=datetime.time(0,0,0), |
|
375 | 416 | endTime=datetime.time(23,59,59), |
|
376 | 417 | walk=True, |
|
377 |
timezone='ut', |
|
|
418 | timezone='ut', | |
|
419 | all=0,): | |
|
378 | 420 | |
|
379 | 421 | self.timezone = timezone |
|
422 | self.all = all | |
|
380 | 423 | #Busqueda de archivos offline |
|
381 | 424 | self.__searchFilesOffline(path, startDate, endDate, startTime, endTime, walk) |
|
382 | 425 |
@@ -30,7 +30,7 class PrintInfo(Operation): | |||
|
30 | 30 | print 'Ipp Seconds: %f'%dataOut.ippSeconds |
|
31 | 31 | print 'Number of Beams: %d'%dataOut.nBeams |
|
32 | 32 | print 'BeamCodes:' |
|
33 |
beamStrList = ['Beam %d -> Code |
|
|
33 | 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()] | |
|
34 | 34 | for b in beamStrList: |
|
35 | 35 | print b |
|
36 | 36 | self.__isPrinted = True |
@@ -76,6 +76,10 class BeamSelector(Operation): | |||
|
76 | 76 | |
|
77 | 77 | if beam != None: |
|
78 | 78 | if self.isProfileInList(dataOut.beamRangeDict[beam]): |
|
79 | beamInfo = dataOut.beamCodeDict[beam] | |
|
80 | dataOut.azimuth = beamInfo[1] | |
|
81 | dataOut.zenith = beamInfo[2] | |
|
82 | dataOut.gain = beamInfo[3] | |
|
79 | 83 | dataOut.flagNoData = False |
|
80 | 84 | |
|
81 | 85 | self.incIndex() |
@@ -50,6 +50,9 class SpectraProc(ProcessingUnit): | |||
|
50 | 50 | self.dataOut.frequency = self.dataIn.frequency |
|
51 | 51 | self.dataOut.realtime = self.dataIn.realtime |
|
52 | 52 | |
|
53 | self.dataOut.azimuth = self.dataIn.azimuth | |
|
54 | self.dataOut.zenith = self.dataIn.zenith | |
|
55 | ||
|
53 | 56 | def __getFft(self): |
|
54 | 57 | """ |
|
55 | 58 | Convierte valores de Voltaje a Spectra |
@@ -41,6 +41,9 class VoltageProc(ProcessingUnit): | |||
|
41 | 41 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
42 | 42 | self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
43 | 43 | self.dataOut.frequency = self.dataIn.frequency |
|
44 | ||
|
45 | self.dataOut.azimuth = self.dataIn.azimuth | |
|
46 | self.dataOut.zenith = self.dataIn.zenith | |
|
44 | 47 | # |
|
45 | 48 | # pass# |
|
46 | 49 | # |
General Comments 0
You need to be logged in to leave comments.
Login now