@@ -58,7 +58,7 class SpectraPlot(Plot): | |||||
58 | self.azimuthList = dataOut.azimuthList |
|
58 | self.azimuthList = dataOut.azimuthList | |
59 |
|
59 | |||
60 | def update(self, dataOut): |
|
60 | def update(self, dataOut): | |
61 |
|
61 | |||
62 | self.update_list(dataOut) |
|
62 | self.update_list(dataOut) | |
63 | data = {} |
|
63 | data = {} | |
64 | meta = {} |
|
64 | meta = {} | |
@@ -629,7 +629,7 class SpectraCutPlot(Plot): | |||||
629 |
|
629 | |||
630 | def plot(self): |
|
630 | def plot(self): | |
631 | if self.xaxis == "frequency": |
|
631 | if self.xaxis == "frequency": | |
632 |
x = self.data.xrange[0][ |
|
632 | x = self.data.xrange[0][0:] | |
633 | self.xlabel = "Frequency (kHz)" |
|
633 | self.xlabel = "Frequency (kHz)" | |
634 | elif self.xaxis == "time": |
|
634 | elif self.xaxis == "time": | |
635 | x = self.data.xrange[1] |
|
635 | x = self.data.xrange[1] |
@@ -83,7 +83,10 class AMISRReader(ProcessingUnit): | |||||
83 | self.dataOut = Voltage() |
|
83 | self.dataOut = Voltage() | |
84 | self.dataOut.error=False |
|
84 | self.dataOut.error=False | |
85 | self.margin_days = 1 |
|
85 | self.margin_days = 1 | |
86 |
|
86 | self.flag_ignoreFiles = False | ||
|
87 | self.ignStartDateTime=None | |||
|
88 | self.ignEndDateTime=None | |||
|
89 | ||||
87 | def setup(self,path=None, |
|
90 | def setup(self,path=None, | |
88 | startDate=None, |
|
91 | startDate=None, | |
89 | endDate=None, |
|
92 | endDate=None, | |
@@ -101,6 +104,10 class AMISRReader(ProcessingUnit): | |||||
101 | margin_days=1, |
|
104 | margin_days=1, | |
102 | nFFT = None, |
|
105 | nFFT = None, | |
103 | nChannels = None, |
|
106 | nChannels = None, | |
|
107 | ignStartDate=None, | |||
|
108 | ignEndDate=None, | |||
|
109 | ignStartTime=None, | |||
|
110 | ignEndTime=None, | |||
104 | ): |
|
111 | ): | |
105 |
|
112 | |||
106 |
|
113 | |||
@@ -118,11 +125,19 class AMISRReader(ProcessingUnit): | |||||
118 |
|
125 | |||
119 | self.nFFT = nFFT |
|
126 | self.nFFT = nFFT | |
120 | self.nChannels = nChannels |
|
127 | self.nChannels = nChannels | |
|
128 | if ignStartTime!=None and ignEndTime!=None: | |||
|
129 | if ignStartDate!=None and ignEndDate!=None: | |||
|
130 | self.ignStartDateTime=datetime.datetime.combine(ignStartDate,ignStartTime) | |||
|
131 | self.ignEndDateTime=datetime.datetime.combine(ignEndDate,ignEndTime) | |||
|
132 | else: | |||
|
133 | self.ignStartDateTime=datetime.datetime.combine(startDate,ignStartTime) | |||
|
134 | self.ignEndDateTime=datetime.datetime.combine(endDate,ignEndTime) | |||
|
135 | self.flag_ignoreFiles = True | |||
121 |
|
136 | |||
122 | #self.findFiles() |
|
137 | #self.findFiles() | |
123 | if not(online): |
|
138 | if not(online): | |
124 | #Busqueda de archivos offline |
|
139 | #Busqueda de archivos offline | |
125 | self.searchFilesOffLine(path, startDate, endDate, startTime, endTime, walk) |
|
140 | self.searchFilesOffLine(path, startDate, endDate, startTime, endTime, walk,) | |
126 | else: |
|
141 | else: | |
127 | self.searchFilesOnLine(path, startDate, endDate, startTime,endTime,walk) |
|
142 | self.searchFilesOnLine(path, startDate, endDate, startTime,endTime,walk) | |
128 |
|
143 | |||
@@ -256,6 +271,7 class AMISRReader(ProcessingUnit): | |||||
256 | self.startTime = startTime |
|
271 | self.startTime = startTime | |
257 | self.endTime = endTime |
|
272 | self.endTime = endTime | |
258 | self.walk = walk |
|
273 | self.walk = walk | |
|
274 | ||||
259 |
|
275 | |||
260 | def __checkPath(self): |
|
276 | def __checkPath(self): | |
261 | if os.path.exists(self.path): |
|
277 | if os.path.exists(self.path): | |
@@ -363,7 +379,7 class AMISRReader(ProcessingUnit): | |||||
363 |
|
379 | |||
364 |
|
380 | |||
365 | def __selectDataForTimes(self, online=False): |
|
381 | def __selectDataForTimes(self, online=False): | |
366 | #aun no esta implementado el filtro for tiempo |
|
382 | #aun no esta implementado el filtro for tiempo-> implementado en readNextFile | |
367 | if not(self.status): |
|
383 | if not(self.status): | |
368 | return None |
|
384 | return None | |
369 |
|
385 | |||
@@ -642,20 +658,21 class AMISRReader(ProcessingUnit): | |||||
642 |
|
658 | |||
643 | #self.__firstFile = False |
|
659 | #self.__firstFile = False | |
644 |
|
660 | |||
645 |
|
||||
646 |
|
||||
647 | self.dataset,self.timeset = self.readData() |
|
661 | self.dataset,self.timeset = self.readData() | |
648 |
|
662 | |||
649 | if self.endDate!=None: |
|
663 | if self.endDate!=None: | |
650 | endDateTime_Reader = datetime.datetime.combine(self.endDate,self.endTime) |
|
664 | endDateTime_Reader = datetime.datetime.combine(self.endDate,self.endTime) | |
651 | time_str = self.amisrFilePointer.get('Time/RadacTimeString') |
|
665 | time_str = self.amisrFilePointer.get('Time/RadacTimeString') | |
652 | startDateTimeStr_File = time_str[0][0].decode('UTF-8').split('.')[0] |
|
666 | startDateTimeStr_File = time_str[0][0].decode('UTF-8').split('.')[0] | |
653 | junk = time.strptime(startDateTimeStr_File, '%Y-%m-%d %H:%M:%S') |
|
667 | junk = time.strptime(startDateTimeStr_File, '%Y-%m-%d %H:%M:%S') | |
654 | startDateTime_File = datetime.datetime(junk.tm_year,junk.tm_mon,junk.tm_mday,junk.tm_hour, junk.tm_min, junk.tm_sec) |
|
668 | startDateTime_File = datetime.datetime(junk.tm_year,junk.tm_mon,junk.tm_mday,junk.tm_hour, junk.tm_min, junk.tm_sec) | |
655 | if self.timezone == 'lt': |
|
669 | if self.timezone == 'lt': | |
656 | startDateTime_File = startDateTime_File - datetime.timedelta(minutes = 300) |
|
670 | startDateTime_File = startDateTime_File - datetime.timedelta(minutes = 300) | |
657 | if (startDateTime_File>endDateTime_Reader): |
|
671 | if (startDateTime_File>endDateTime_Reader): | |
658 | return 0 |
|
672 | return 0 | |
|
673 | if self.flag_ignoreFiles and (startDateTime_File >= self.ignStartDateTime and startDateTime_File <= self.ignEndDateTime): | |||
|
674 | print("Ignoring...") | |||
|
675 | return 0 | |||
659 |
|
676 | |||
660 | self.jrodataset = self.reshapeData() |
|
677 | self.jrodataset = self.reshapeData() | |
661 | #----self.updateIndexes() |
|
678 | #----self.updateIndexes() | |
@@ -679,11 +696,13 class AMISRReader(ProcessingUnit): | |||||
679 | if self.profileIndex >= (self.newProfiles*self.nblocks): # |
|
696 | if self.profileIndex >= (self.newProfiles*self.nblocks): # | |
680 | #if self.__hasNotDataInBuffer(): |
|
697 | #if self.__hasNotDataInBuffer(): | |
681 | if not (self.readNextFile(self.online)): |
|
698 | if not (self.readNextFile(self.online)): | |
|
699 | print("Profile Index break...") | |||
682 | return 0 |
|
700 | return 0 | |
683 |
|
701 | |||
684 |
|
702 | |||
685 | if self.dataset is None: # setear esta condicion cuando no hayan datos por leer |
|
703 | if self.dataset is None: # setear esta condicion cuando no hayan datos por leer | |
686 | self.dataOut.flagNoData = True |
|
704 | self.dataOut.flagNoData = True | |
|
705 | print("No more data break...") | |||
687 | return 0 |
|
706 | return 0 | |
688 |
|
707 | |||
689 | #self.dataOut.data = numpy.reshape(self.jrodataset[self.profileIndex,:],(1,-1)) |
|
708 | #self.dataOut.data = numpy.reshape(self.jrodataset[self.profileIndex,:],(1,-1)) |
@@ -133,7 +133,7 class SpectraProc(ProcessingUnit): | |||||
133 | self.dataOut.blockSize = blocksize |
|
133 | self.dataOut.blockSize = blocksize | |
134 | self.dataOut.flagShiftFFT = False |
|
134 | self.dataOut.flagShiftFFT = False | |
135 |
|
135 | |||
136 | def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False, zeroPad=False): |
|
136 | def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False, zeroPad=False, zeroPoints=0): | |
137 |
|
137 | |||
138 |
|
138 | |||
139 | try: |
|
139 | try: | |
@@ -180,7 +180,7 class SpectraProc(ProcessingUnit): | |||||
180 | if ippFactor == None: |
|
180 | if ippFactor == None: | |
181 | self.dataOut.ippFactor = 1 |
|
181 | self.dataOut.ippFactor = 1 | |
182 |
|
182 | |||
183 | self.dataOut.nFFTPoints = nFFTPoints |
|
183 | ||
184 | #print(" volts ch,prof, h: ", self.dataIn.data.shape) |
|
184 | #print(" volts ch,prof, h: ", self.dataIn.data.shape) | |
185 | if self.buffer is None: |
|
185 | if self.buffer is None: | |
186 | if not zeroPad: |
|
186 | if not zeroPad: | |
@@ -188,15 +188,18 class SpectraProc(ProcessingUnit): | |||||
188 | nProfiles, |
|
188 | nProfiles, | |
189 | self.dataIn.nHeights), |
|
189 | self.dataIn.nHeights), | |
190 | dtype='complex') |
|
190 | dtype='complex') | |
|
191 | zeroPoints = 0 | |||
191 | else: |
|
192 | else: | |
192 | self.buffer = numpy.zeros((self.dataIn.nChannels, |
|
193 | self.buffer = numpy.zeros((self.dataIn.nChannels, | |
193 | nFFTPoints, |
|
194 | nFFTPoints+int(zeroPoints), | |
194 | self.dataIn.nHeights), |
|
195 | self.dataIn.nHeights), | |
195 | dtype='complex') |
|
196 | dtype='complex') | |
|
197 | ||||
|
198 | self.dataOut.nFFTPoints = nFFTPoints + int(zeroPoints) | |||
196 |
|
199 | |||
197 | if self.dataIn.flagDataAsBlock: |
|
200 | if self.dataIn.flagDataAsBlock: | |
198 | nVoltProfiles = self.dataIn.data.shape[1] |
|
201 | nVoltProfiles = self.dataIn.data.shape[1] | |
199 |
|
202 | zeroPoints = 0 | ||
200 | if nVoltProfiles == nProfiles or zeroPad: |
|
203 | if nVoltProfiles == nProfiles or zeroPad: | |
201 | self.buffer = self.dataIn.data.copy() |
|
204 | self.buffer = self.dataIn.data.copy() | |
202 | self.profIndex = nVoltProfiles |
|
205 | self.profIndex = nVoltProfiles | |
@@ -223,7 +226,7 class SpectraProc(ProcessingUnit): | |||||
223 | if self.firstdatatime == None: |
|
226 | if self.firstdatatime == None: | |
224 | self.firstdatatime = self.dataIn.utctime |
|
227 | self.firstdatatime = self.dataIn.utctime | |
225 |
|
228 | |||
226 | if self.profIndex == nProfiles or zeroPad: |
|
229 | if self.profIndex == nProfiles or (zeroPad and zeroPoints==0): | |
227 |
|
230 | |||
228 | self.__updateSpecFromVoltage() |
|
231 | self.__updateSpecFromVoltage() | |
229 |
|
232 |
@@ -3778,9 +3778,9 class remHeightsIppInterf(Operation): | |||||
3778 |
|
3778 | |||
3779 | for hk in self.heights_indx.flatten(): |
|
3779 | for hk in self.heights_indx.flatten(): | |
3780 | if dataOut.data.ndim < 3: |
|
3780 | if dataOut.data.ndim < 3: | |
3781 | dataOut.data[ch,hk] = 0 + 0j |
|
3781 | dataOut.data[ch,hk] = 0.0 + 0.0j | |
3782 | else: |
|
3782 | else: | |
3783 | dataOut.data[ch,:,hk] = 0 + 0j |
|
3783 | dataOut.data[ch,:,hk] = 0.0 + 0.0j | |
3784 |
|
3784 | |||
3785 | dataOut.flagProfilesByRange = True |
|
3785 | dataOut.flagProfilesByRange = True | |
3786 |
|
3786 |
General Comments 0
You need to be logged in to leave comments.
Login now