@@ -89,9 +89,9 class Voltage(JROData): | |||||
89 | Constructor |
|
89 | Constructor | |
90 | ''' |
|
90 | ''' | |
91 |
|
91 | |||
92 |
self. |
|
92 | self.radarControllerHeaderObj = RadarControllerHeader() | |
93 |
|
93 | |||
94 |
self. |
|
94 | self.systemHeaderObj = SystemHeader() | |
95 |
|
95 | |||
96 | self.type = "Voltage" |
|
96 | self.type = "Voltage" | |
97 |
|
97 | |||
@@ -143,9 +143,9 class Spectra(JROData): | |||||
143 | Constructor |
|
143 | Constructor | |
144 | ''' |
|
144 | ''' | |
145 |
|
145 | |||
146 |
self. |
|
146 | self.radarControllerHeaderObj = RadarControllerHeader() | |
147 |
|
147 | |||
148 |
self. |
|
148 | self.systemHeaderObj = SystemHeader() | |
149 |
|
149 | |||
150 | self.type = "Spectra" |
|
150 | self.type = "Spectra" | |
151 |
|
151 | |||
@@ -190,9 +190,9 class SpectraHeis(JROData): | |||||
190 |
|
190 | |||
191 | def __init__(self): |
|
191 | def __init__(self): | |
192 |
|
192 | |||
193 |
self. |
|
193 | self.radarControllerHeaderObj = RadarControllerHeader() | |
194 |
|
194 | |||
195 |
self. |
|
195 | self.systemHeaderObj = SystemHeader() | |
196 |
|
196 | |||
197 | self.type = "SpectraHeis" |
|
197 | self.type = "SpectraHeis" | |
198 |
|
198 |
@@ -14,10 +14,10 import datetime | |||||
14 |
|
14 | |||
15 | #import plplot |
|
15 | #import plplot | |
16 | import matplotlib as mpl |
|
16 | import matplotlib as mpl | |
17 | mpl.use('TKAgg') |
|
17 | #mpl.use('TKAgg') | |
18 | import matplotlib.pyplot as plt |
|
18 | import matplotlib.pyplot as plt | |
19 |
|
19 | |||
20 | import scitools.numpyutils as sn |
|
20 | #import scitools.numpyutils as sn | |
21 |
|
21 | |||
22 | def cmap1_init(colormap='gray'): |
|
22 | def cmap1_init(colormap='gray'): | |
23 |
|
23 |
@@ -312,7 +312,7 class ProcessingHeader(Header): | |||||
312 |
|
312 | |||
313 | def __init__(self): |
|
313 | def __init__(self): | |
314 | self.size = 0 |
|
314 | self.size = 0 | |
315 |
self.d |
|
315 | self.dtype = 0 | |
316 | self.blockSize = 0 |
|
316 | self.blockSize = 0 | |
317 | self.profilesPerBlock = 0 |
|
317 | self.profilesPerBlock = 0 | |
318 | self.dataBlocksPerFile = 0 |
|
318 | self.dataBlocksPerFile = 0 | |
@@ -351,7 +351,7 class ProcessingHeader(Header): | |||||
351 | try: |
|
351 | try: | |
352 | header = numpy.fromfile(fp,self.struct,1) |
|
352 | header = numpy.fromfile(fp,self.struct,1) | |
353 | self.size = header['nSize'][0] |
|
353 | self.size = header['nSize'][0] | |
354 |
self.d |
|
354 | self.dtype = header['nDataType'][0] | |
355 | self.blockSize = header['nSizeOfDataBlock'][0] |
|
355 | self.blockSize = header['nSizeOfDataBlock'][0] | |
356 | self.profilesPerBlock = header['nProfilesperBlock'][0] |
|
356 | self.profilesPerBlock = header['nProfilesperBlock'][0] | |
357 | self.dataBlocksPerFile = header['nDataBlocksperFile'][0] |
|
357 | self.dataBlocksPerFile = header['nDataBlocksperFile'][0] | |
@@ -402,7 +402,7 class ProcessingHeader(Header): | |||||
402 |
|
402 | |||
403 | def write(self, fp): |
|
403 | def write(self, fp): | |
404 | headerTuple = (self.size, |
|
404 | headerTuple = (self.size, | |
405 |
self.d |
|
405 | self.dtype, | |
406 | self.blockSize, |
|
406 | self.blockSize, | |
407 | self.profilesPerBlock, |
|
407 | self.profilesPerBlock, | |
408 | self.dataBlocksPerFile, |
|
408 | self.dataBlocksPerFile, |
@@ -107,7 +107,7 class SpectraProcessor: | |||||
107 | self.dataOutObj.flagNoData = False |
|
107 | self.dataOutObj.flagNoData = False | |
108 | return |
|
108 | return | |
109 |
|
109 | |||
110 |
raise ValueError, "The d |
|
110 | raise ValueError, "The dtype is not valid" | |
111 |
|
111 | |||
112 | def __getFft(self): |
|
112 | def __getFft(self): | |
113 | """ |
|
113 | """ | |
@@ -120,16 +120,16 class SpectraProcessor: | |||||
120 | self.dataOutObj.heightList |
|
120 | self.dataOutObj.heightList | |
121 | self.dataOutObj.m_BasicHeader |
|
121 | self.dataOutObj.m_BasicHeader | |
122 | self.dataOutObj.m_ProcessingHeader |
|
122 | self.dataOutObj.m_ProcessingHeader | |
123 |
self.dataOutObj. |
|
123 | self.dataOutObj.radarControllerHeaderObj | |
124 |
self.dataOutObj. |
|
124 | self.dataOutObj.systemHeaderObj | |
125 | self.profIndex |
|
125 | self.profIndex | |
126 | self.buffer |
|
126 | self.buffer | |
127 | self.dataOutObj.flagNoData |
|
127 | self.dataOutObj.flagNoData | |
128 |
self.dataOutObj.d |
|
128 | self.dataOutObj.dtype | |
129 | self.dataOutObj.nPairs |
|
129 | self.dataOutObj.nPairs | |
130 | self.dataOutObj.nChannels |
|
130 | self.dataOutObj.nChannels | |
131 | self.dataOutObj.nProfiles |
|
131 | self.dataOutObj.nProfiles | |
132 |
self.dataOutObj. |
|
132 | self.dataOutObj.systemHeaderObj.numChannels | |
133 | self.dataOutObj.m_ProcessingHeader.totalSpectra |
|
133 | self.dataOutObj.m_ProcessingHeader.totalSpectra | |
134 | self.dataOutObj.m_ProcessingHeader.profilesPerBlock |
|
134 | self.dataOutObj.m_ProcessingHeader.profilesPerBlock | |
135 | self.dataOutObj.m_ProcessingHeader.numHeights |
|
135 | self.dataOutObj.m_ProcessingHeader.numHeights | |
@@ -287,7 +287,9 class SpectraProcessor: | |||||
287 |
|
287 | |||
288 |
|
288 | |||
289 | class SpectraHeisProcessor: |
|
289 | class SpectraHeisProcessor: | |
|
290 | ||||
290 | def __init__(self): |
|
291 | def __init__(self): | |
|
292 | ||||
291 | self.integratorObjIndex = None |
|
293 | self.integratorObjIndex = None | |
292 | self.writerObjIndex = None |
|
294 | self.writerObjIndex = None | |
293 | self.plotterObjIndex = None |
|
295 | self.plotterObjIndex = None | |
@@ -296,12 +298,10 class SpectraHeisProcessor: | |||||
296 | self.plotterObjList = [] |
|
298 | self.plotterObjList = [] | |
297 | #self.noiseObj = Noise() |
|
299 | #self.noiseObj = Noise() | |
298 |
|
300 | |||
299 |
def setup(self,dataInObj |
|
301 | def setup(self, dataInObj, dataOutObj=None, nFFTPoints=None, pairList=None): | |
300 | if dataInObj == None: |
|
|||
301 | raise ValueError, "" |
|
|||
302 |
|
302 | |||
303 | if nFFTPoints == None: |
|
303 | if nFFTPoints == None: | |
304 | raise ValueError, "" |
|
304 | nFFTPoints = self.dataInObj.nHeights | |
305 |
|
305 | |||
306 | self.dataInObj = dataInObj |
|
306 | self.dataInObj = dataInObj | |
307 |
|
307 | |||
@@ -316,49 +316,63 class SpectraHeisProcessor: | |||||
316 | self.nChannels = self.dataInObj.nChannels |
|
316 | self.nChannels = self.dataInObj.nChannels | |
317 | self.nHeights = self.dataInObj.nHeights |
|
317 | self.nHeights = self.dataInObj.nHeights | |
318 | self.pairList = pairList |
|
318 | self.pairList = pairList | |
|
319 | ||||
319 | if pairList != None: |
|
320 | if pairList != None: | |
320 | self.nPairs = len(pairList) |
|
321 | self.nPairs = len(pairList) | |
321 | else: |
|
322 | else: | |
322 | self.nPairs = 0 |
|
323 | self.nPairs = 0 | |
323 |
|
324 | |||
324 | self.dataOutObj.heightList = self.dataInObj.heightList |
|
325 | self.dataOutObj.radarControllerHeaderObj = self.dataInObj.radarControllerHeaderObj.copy() | |
325 |
self.dataOutObj. |
|
326 | self.dataOutObj.systemHeaderObj = self.dataInObj.systemHeaderObj.copy() | |
326 | self.dataOutObj.m_RadarControllerHeader = self.dataInObj.m_RadarControllerHeader.copy() |
|
327 | ||
327 | self.dataOutObj.m_SystemHeader = self.dataInObj.m_SystemHeader.copy() |
|
328 | self.dataOutObj.type = "SpectraHeis" | |
|
329 | ||||
|
330 | self.dataOutObj.dtype = self.dataInObj.dtype | |||
328 |
|
331 | |||
329 | self.dataOutObj.dataType = self.dataInObj.dataType |
|
|||
330 | self.dataOutObj.nPairs = self.nPairs |
|
|||
331 | self.dataOutObj.nChannels = self.nChannels |
|
332 | self.dataOutObj.nChannels = self.nChannels | |
332 | self.dataOutObj.nProfiles = self.nFFTPoints |
|
333 | ||
333 | self.dataOutObj.nHeights = self.nHeights |
|
334 | self.dataOutObj.nHeights = self.nHeights | |
334 | self.dataOutObj.nFFTPoints = self.nFFTPoints |
|
|||
335 | #self.dataOutObj.data = None |
|
|||
336 |
|
335 | |||
337 |
self.dataOutObj. |
|
336 | self.dataOutObj.nProfiles = self.nFFTPoints | |
338 | self.dataOutObj.m_SystemHeader.nProfiles = self.nFFTPoints |
|
337 | ||
|
338 | self.dataOutObj.heightList = None | |||
|
339 | ||||
|
340 | self.dataOutObj.channelList = None | |||
|
341 | ||||
|
342 | self.dataOutObj.channelIndexList = None | |||
|
343 | ||||
|
344 | self.dataOutObj.flagNoData = False | |||
|
345 | ||||
|
346 | self.dataOutObj.flagTimeBlock = False | |||
|
347 | ||||
|
348 | self.dataOutObj.dataUtcTime = None | |||
339 |
|
349 | |||
340 | self.dataOutObj.m_ProcessingHeader.totalSpectra = self.nChannels + self.nPairs |
|
350 | self.dataOutObj.nCode = None | |
341 | self.dataOutObj.m_ProcessingHeader.profilesPerBlock = self.nFFTPoints |
|
|||
342 | self.dataOutObj.m_ProcessingHeader.numHeights = self.nHeights |
|
|||
343 | self.dataOutObj.m_ProcessingHeader.shif_fft = True |
|
|||
344 |
|
351 | |||
345 | spectraComb = numpy.zeros( (self.nChannels+self.nPairs)*2,numpy.dtype('u1')) |
|
352 | self.dataOutObj.nBaud = None | |
346 | k = 0 |
|
|||
347 | for i in range( 0,self.nChannels*2,2 ): |
|
|||
348 | spectraComb[i] = k |
|
|||
349 | spectraComb[i+1] = k |
|
|||
350 | k += 1 |
|
|||
351 |
|
353 | |||
352 | k *= 2 |
|
354 | self.dataOutObj.code = None | |
|
355 | ||||
|
356 | self.dataOutObj.flagDecodeData = True #asumo q la data esta decodificada | |||
|
357 | ||||
|
358 | self.dataOutObj.flagDeflipData = True #asumo q la data esta sin flip | |||
|
359 | ||||
|
360 | self.dataOutObj.flagShiftFFT = False | |||
|
361 | ||||
|
362 | self.dataOutObj.ippSeconds = None | |||
353 |
|
363 | |||
354 | if self.pairList != None: |
|
364 | self.dataOutObjdata_spc = None | |
355 |
|
365 | |||
356 | for pair in self.pairList: |
|
366 | self.dataOutObjdata_cspc = None | |
357 | spectraComb[k] = pair[0] |
|
367 | ||
358 | spectraComb[k+1] = pair[1] |
|
368 | self.dataOutObjdata_dc = None | |
359 | k += 2 |
|
369 | ||
360 |
|
370 | self.dataOutObjnFFTPoints = None | ||
361 | self.dataOutObj.m_ProcessingHeader.spectraComb = spectraComb |
|
371 | ||
|
372 | self.dataOutObjnPairs = None | |||
|
373 | ||||
|
374 | self.dataOutObjpairsList = None | |||
|
375 | ||||
362 |
|
376 | |||
363 | return self.dataOutObj |
|
377 | return self.dataOutObj | |
364 |
|
378 | |||
@@ -378,7 +392,7 class SpectraHeisProcessor: | |||||
378 | self.dataOutObj.flagNoData = False |
|
392 | self.dataOutObj.flagNoData = False | |
379 | return |
|
393 | return | |
380 |
|
394 | |||
381 |
raise ValueError, "The |
|
395 | raise ValueError, "The type is not valid" | |
382 |
|
396 | |||
383 | def __getFft(self): |
|
397 | def __getFft(self): | |
384 | if self.dataInObj.flagNoData: |
|
398 | if self.dataInObj.flagNoData: |
@@ -284,8 +284,8 class CoherentIntegrator: | |||||
284 | return |
|
284 | return | |
285 |
|
285 | |||
286 | #Overlapping data |
|
286 | #Overlapping data | |
287 |
nChannels, n |
|
287 | nChannels, nHeis = data.shape | |
288 |
data = numpy.reshape(data, (1, nChannels, n |
|
288 | data = numpy.reshape(data, (1, nChannels, nHeis)) | |
289 |
|
289 | |||
290 | if self.__buffer == None: |
|
290 | if self.__buffer == None: | |
291 | self.__buffer = data |
|
291 | self.__buffer = data |
@@ -27,6 +27,7 class TestHeis(): | |||||
27 | self.createObjects() |
|
27 | self.createObjects() | |
28 | self.testSChain() |
|
28 | self.testSChain() | |
29 | self.i=0 |
|
29 | self.i=0 | |
|
30 | ||||
30 | def setValues( self ): |
|
31 | def setValues( self ): | |
31 |
|
32 | |||
32 | self.path="C:\data2" |
|
33 | self.path="C:\data2" |
@@ -9,7 +9,7 import time, datetime | |||||
9 | path = os.path.split(os.getcwd())[0] |
|
9 | path = os.path.split(os.getcwd())[0] | |
10 | sys.path.append(path) |
|
10 | sys.path.append(path) | |
11 |
|
11 | |||
12 |
from Data. |
|
12 | from Data.JROData import Voltage | |
13 | from IO.VoltageIO import * |
|
13 | from IO.VoltageIO import * | |
14 |
|
14 | |||
15 | from Processing.VoltageProcessor import * |
|
15 | from Processing.VoltageProcessor import * | |
@@ -23,30 +23,24 class TestSChain(): | |||||
23 | self.testSChain() |
|
23 | self.testSChain() | |
24 |
|
24 | |||
25 | def setValues(self): |
|
25 | def setValues(self): | |
26 |
self.path = "/home/ |
|
26 | self.path = "/home/roj-idl71/Data/RAWDATA/Meteors" | |
27 | self.startDate = datetime.date(2012,6,1) |
|
|||
28 | self.endDate = datetime.date(2012,7,30) |
|
|||
29 |
|
27 | |||
30 | # self.path = "/Users/danielangelsuarezmunoz/Data/Imaging_rawdata" |
|
28 | self.startDate = datetime.date(2005,1,1) | |
31 |
|
|
29 | self.endDate = datetime.date(2012,7,30) | |
32 | # self.endDate = datetime.date(2011,10,4) |
|
|||
33 |
|
||||
34 | # Probando los escritos por Signal Chain |
|
|||
35 | # self.path = "/home/dsuarez/RadaData" |
|
|||
36 | # self.startDate = datetime.date(2011,11,28) |
|
|||
37 | # self.endDate = datetime.date(2011,11,30) |
|
|||
38 |
|
30 | |||
39 | self.startTime = datetime.time(0,0,0) |
|
31 | self.startTime = datetime.time(0,0,0) | |
40 | self.endTime = datetime.time(23,59,59) |
|
32 | self.endTime = datetime.time(23,59,59) | |
41 |
|
33 | |||
42 |
self.wrpath = "/home/ |
|
34 | self.wrpath = "/home/roj-idl71/tmp/results" | |
43 | self.profilesPerBlock = 40 |
|
35 | self.profilesPerBlock = 40 | |
44 | self.blocksPerFile = 50 |
|
36 | self.blocksPerFile = 50 | |
45 |
|
37 | |||
46 | def createObjects(self): |
|
38 | def createObjects(self): | |
47 |
|
39 | |||
48 | self.readerObj = VoltageReader() |
|
40 | self.readerObj = VoltageReader() | |
49 |
|
41 | self.voltProcObj = VoltageProcessor() | ||
|
42 | self.specProcObj = SpectraProcessor() | |||
|
43 | ||||
50 | self.voltObj1 = self.readerObj.setup( |
|
44 | self.voltObj1 = self.readerObj.setup( | |
51 | path = self.path, |
|
45 | path = self.path, | |
52 | startDate = self.startDate, |
|
46 | startDate = self.startDate, | |
@@ -54,11 +48,9 class TestSChain(): | |||||
54 | startTime = self.startTime, |
|
48 | startTime = self.startTime, | |
55 | endTime = self.endTime, |
|
49 | endTime = self.endTime, | |
56 | expLabel = '', |
|
50 | expLabel = '', | |
57 | online = 0) |
|
51 | online = 0) | |
58 |
|
||||
59 | self.voltObjProc = VoltageProcessor() |
|
|||
60 |
|
52 | |||
61 |
self.voltObj2 = self.volt |
|
53 | self.voltObj2 = self.voltProcObj.setup(dataInObj = self.voltObj1) | |
62 |
|
54 | |||
63 | def testSChain(self): |
|
55 | def testSChain(self): | |
64 |
|
56 | |||
@@ -67,12 +59,14 class TestSChain(): | |||||
67 | while(True): |
|
59 | while(True): | |
68 | self.readerObj.getData() |
|
60 | self.readerObj.getData() | |
69 |
|
61 | |||
70 |
self.volt |
|
62 | self.voltProcObj.init() | |
|
63 | ||||
|
64 | self.voltProcObj.integrator(1000, overlapping=True) | |||
71 | # |
|
65 | # | |
72 |
# self.volt |
|
66 | # self.voltProcObj.writeData(self.wrpath,self.profilesPerBlock,self.blocksPerFile) | |
73 |
|
67 | |||
74 |
|
68 | |||
75 |
self.volt |
|
69 | self.voltProcObj.plotScope(idfigure=1, | |
76 | wintitle='test plot library', |
|
70 | wintitle='test plot library', | |
77 | driver='plplot', |
|
71 | driver='plplot', | |
78 | save=False, |
|
72 | save=False, |
General Comments 0
You need to be logged in to leave comments.
Login now