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