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