@@ -86,6 +86,7 class DigitalRFReader(ProcessingUnit): | |||
|
86 | 86 | # self.dataOut.channelIndexList = None |
|
87 | 87 | |
|
88 | 88 | self.dataOut.flagNoData = True |
|
89 | ||
|
89 | 90 | self.dataOut.flagDataAsBlock = False |
|
90 | 91 | # Set to TRUE if the data is discontinuous |
|
91 | 92 | self.dataOut.flagDiscontinuousBlock = False |
@@ -98,13 +99,15 class DigitalRFReader(ProcessingUnit): | |||
|
98 | 99 | |
|
99 | 100 | self.dataOut.errorCount = 0 |
|
100 | 101 | |
|
101 |
self.dataOut.nCohInt = |
|
|
102 | self.dataOut.nCohInt = self.fixed_metadata_dict['nCohInt'] | |
|
103 | ||
|
104 | self.dataOut.flagDecodeData = self.fixed_metadata_dict['flagDecodeData'] # asumo que la data esta decodificada | |
|
102 | 105 | |
|
103 |
self.dataOut.flagDe |
|
|
106 | self.dataOut.flagDeflipData = self.fixed_metadata_dict['flagDeflipData'] # asumo que la data esta sin flip | |
|
104 | 107 | |
|
105 | self.dataOut.flagDeflipData = False # asumo que la data esta sin flip | |
|
108 | self.dataOut.flagShiftFFT = self.fixed_metadata_dict['flagShiftFFT'] | |
|
106 | 109 | |
|
107 | self.dataOut.flagShiftFFT = False | |
|
110 | self.dataOut.useLocalTime = self.fixed_metadata_dict['useLocalTime'] | |
|
108 | 111 | |
|
109 | 112 | self.dataOut.ippSeconds = ippSeconds |
|
110 | 113 | |
@@ -178,10 +181,10 class DigitalRFReader(ProcessingUnit): | |||
|
178 | 181 | endTime = datetime.time(23,59,59), |
|
179 | 182 | channelList = None, |
|
180 | 183 | nSamples = None, |
|
181 | ippKm = 60, | |
|
182 | 184 | online = False, |
|
183 | 185 | delay = 60, |
|
184 | 186 | buffer_size = 1024, |
|
187 | ippKm=None, | |
|
185 | 188 | **kwargs): |
|
186 | 189 | ''' |
|
187 | 190 | In this method we should set all initial parameters. |
@@ -221,6 +224,7 class DigitalRFReader(ProcessingUnit): | |||
|
221 | 224 | top_properties = self.digitalReadObj.get_properties(channelNameList[channelList[0]]) |
|
222 | 225 | |
|
223 | 226 | self.__sample_rate = 1.0 * top_properties['sample_rate_numerator'] / top_properties['sample_rate_denominator'] |
|
227 | ||
|
224 | 228 | # self.__samples_per_file = top_properties['samples_per_file'][0] |
|
225 | 229 | self.__deltaHeigth = 1e6*0.15/self.__sample_rate ## why 0.15? |
|
226 | 230 | |
@@ -240,16 +244,16 class DigitalRFReader(ProcessingUnit): | |||
|
240 | 244 | self.__frequency = None |
|
241 | 245 | |
|
242 | 246 | try: |
|
243 | self.__timezone = self.fixed_metadata_dict['timezone'] | |
|
247 | self.__timezone = self.fixed_metadata_dict['timezone'] * 60 | |
|
244 | 248 | except: |
|
245 | 249 | self.__timezone = 0 |
|
246 | 250 | |
|
247 | ||
|
251 | ||
|
248 | 252 | try: |
|
249 |
nSamples = self. |
|
|
253 | nSamples = self.fixed_metadata_dict['nSamples'] | |
|
250 | 254 | except: |
|
251 | 255 | nSamples = None |
|
252 | ||
|
256 | ||
|
253 | 257 | self.__firstHeigth = 0 |
|
254 | 258 | |
|
255 | 259 | try: |
@@ -269,7 +273,7 class DigitalRFReader(ProcessingUnit): | |||
|
269 | 273 | if not ippKm: |
|
270 | 274 | try: |
|
271 | 275 | # seconds to km |
|
272 |
ippKm = |
|
|
276 | ippKm = self.__radarControllerHeader['ipp'] | |
|
273 | 277 | except: |
|
274 | 278 | ippKm = None |
|
275 | 279 | #################################################### |
@@ -297,12 +301,12 class DigitalRFReader(ProcessingUnit): | |||
|
297 | 301 | |
|
298 | 302 | if end_index < endUTCSecond*self.__sample_rate: |
|
299 | 303 | endUTCSecond = end_index/self.__sample_rate |
|
300 | ||
|
304 | print ippKm | |
|
301 | 305 | if not nSamples: |
|
302 | 306 | if not ippKm: |
|
303 | 307 | raise ValueError, "[Reading] nSamples or ippKm should be defined" |
|
304 | 308 | nSamples = int(ippKm / (1e6*0.15/self.__sample_rate)) |
|
305 | ||
|
309 | print nSamples | |
|
306 | 310 | channelBoundList = [] |
|
307 | 311 | channelNameListFiltered = [] |
|
308 | 312 | |
@@ -531,7 +535,6 class DigitalRFReader(ProcessingUnit): | |||
|
531 | 535 | |
|
532 | 536 | if not self.isConfig: |
|
533 | 537 | self.setup(**kwargs) |
|
534 | print self.dataOut.dtype | |
|
535 | 538 | self.i = self.i+1 |
|
536 | 539 | self.getData(seconds=self.__delay) |
|
537 | 540 | |
@@ -550,15 +553,27 class DigitalRFWriter(Operation): | |||
|
550 | 553 | self.metadata_dict = {} |
|
551 | 554 | self.dataOut = None |
|
552 | 555 | |
|
556 | def setHeader(self, dataOut): | |
|
557 | return | |
|
558 | ||
|
553 | 559 | def setup(self, dataOut, path, frequency, set=0, metadataFile='metadata', ext='.h5'): |
|
554 | 560 | ''' |
|
555 | 561 | In this method we should set all initial parameters. |
|
556 | 562 | Input: |
|
557 | 563 | dataOut: Input data will also be outputa data |
|
558 | 564 | ''' |
|
559 | self.metadata_dict['frequency'] = frequency | |
|
560 |
self.metadata_dict['timezone'] = |
|
|
565 | self.metadata_dict['frequency'] = dataOut.frequency | |
|
566 | self.metadata_dict['timezone'] = dataOut.timeZone | |
|
561 | 567 | self.metadata_dict['dtype'] = cPickle.dumps(dataOut.dtype) |
|
568 | self.metadata_dict['nProfiles'] = dataOut.nProfiles | |
|
569 | self.metadata_dict['heightList'] = dataOut.heightList | |
|
570 | self.metadata_dict['channelList'] = dataOut.channelList | |
|
571 | self.metadata_dict['flagDecodeData'] = dataOut.flagDecodeData | |
|
572 | self.metadata_dict['flagDeflipData'] = dataOut.flagDeflipData | |
|
573 | self.metadata_dict['flagShiftFFT'] = dataOut.flagShiftFFT | |
|
574 | self.metadata_dict['flagDataAsBlock'] = dataOut.flagDataAsBlock | |
|
575 | self.metadata_dict['useLocalTime'] = dataOut.useLocalTime | |
|
576 | self.metadata_dict['nCohInt'] = dataOut.nCohInt | |
|
562 | 577 | |
|
563 | 578 | self.__ippSeconds = dataOut.ippSeconds |
|
564 | 579 | self.__deltaH = dataOut.getDeltaH() |
General Comments 0
You need to be logged in to leave comments.
Login now