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