##// END OF EJS Templates
getting the experiment parameters from cfg files
Daniel Valdez -
r478:ecf5abfd8d13
parent child
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -1,702 +1,702
1 '''
1 '''
2
2
3 $Author: murco $
3 $Author: murco $
4 $Id: JROData.py 173 2012-11-20 15:06:21Z murco $
4 $Id: JROData.py 173 2012-11-20 15:06:21Z murco $
5 '''
5 '''
6
6
7 import os, sys
7 import os, sys
8 import copy
8 import copy
9 import numpy
9 import numpy
10 import datetime
10 import datetime
11 import time
11 import time
12 from jroheaderIO import SystemHeader, RadarControllerHeader
12 from jroheaderIO import SystemHeader, RadarControllerHeader
13
13
14
14
15 def hildebrand_sekhon(data, navg):
15 def hildebrand_sekhon(data, navg):
16
16
17 data = data.copy()
17 data = data.copy()
18
18
19 sortdata = numpy.sort(data,axis=None)
19 sortdata = numpy.sort(data,axis=None)
20 lenOfData = len(sortdata)
20 lenOfData = len(sortdata)
21 nums_min = lenOfData/10
21 nums_min = lenOfData/10
22
22
23 if (lenOfData/10) > 2:
23 if (lenOfData/10) > 2:
24 nums_min = lenOfData/10
24 nums_min = lenOfData/10
25 else:
25 else:
26 nums_min = 2
26 nums_min = 2
27
27
28 sump = 0.
28 sump = 0.
29
29
30 sumq = 0.
30 sumq = 0.
31
31
32 j = 0
32 j = 0
33
33
34 cont = 1
34 cont = 1
35
35
36 while((cont==1)and(j<lenOfData)):
36 while((cont==1)and(j<lenOfData)):
37
37
38 sump += sortdata[j]
38 sump += sortdata[j]
39
39
40 sumq += sortdata[j]**2
40 sumq += sortdata[j]**2
41
41
42 j += 1
42 j += 1
43
43
44 if j > nums_min:
44 if j > nums_min:
45 rtest = float(j)/(j-1) + 1.0/navg
45 rtest = float(j)/(j-1) + 1.0/navg
46 if ((sumq*j) > (rtest*sump**2)):
46 if ((sumq*j) > (rtest*sump**2)):
47 j = j - 1
47 j = j - 1
48 sump = sump - sortdata[j]
48 sump = sump - sortdata[j]
49 sumq = sumq - sortdata[j]**2
49 sumq = sumq - sortdata[j]**2
50 cont = 0
50 cont = 0
51
51
52 lnoise = sump /j
52 lnoise = sump /j
53 stdv = numpy.sqrt((sumq - lnoise**2)/(j - 1))
53 stdv = numpy.sqrt((sumq - lnoise**2)/(j - 1))
54 return lnoise
54 return lnoise
55
55
56 class JROData:
56 class JROData:
57
57
58 # m_BasicHeader = BasicHeader()
58 # m_BasicHeader = BasicHeader()
59 # m_ProcessingHeader = ProcessingHeader()
59 # m_ProcessingHeader = ProcessingHeader()
60
60
61 systemHeaderObj = SystemHeader()
61 systemHeaderObj = SystemHeader()
62
62
63 radarControllerHeaderObj = RadarControllerHeader()
63 radarControllerHeaderObj = RadarControllerHeader()
64
64
65 # data = None
65 # data = None
66
66
67 type = None
67 type = None
68
68
69 dtype = None
69 dtype = None
70
70
71 # nChannels = None
71 # nChannels = None
72
72
73 # nHeights = None
73 # nHeights = None
74
74
75 nProfiles = None
75 nProfiles = None
76
76
77 heightList = None
77 heightList = None
78
78
79 channelList = None
79 channelList = None
80
80
81 flagNoData = True
81 flagNoData = True
82
82
83 flagTimeBlock = False
83 flagTimeBlock = False
84
84
85 useLocalTime = False
85 useLocalTime = False
86
86
87 utctime = None
87 utctime = None
88
88
89 timeZone = None
89 timeZone = None
90
90
91 dstFlag = None
91 dstFlag = None
92
92
93 errorCount = None
93 errorCount = None
94
94
95 blocksize = None
95 blocksize = None
96
96
97 nCode = None
97 nCode = None
98
98
99 nBaud = None
99 nBaud = None
100
100
101 code = None
101 code = None
102
102
103 flagDecodeData = False #asumo q la data no esta decodificada
103 flagDecodeData = False #asumo q la data no esta decodificada
104
104
105 flagDeflipData = False #asumo q la data no esta sin flip
105 flagDeflipData = False #asumo q la data no esta sin flip
106
106
107 flagShiftFFT = False
107 flagShiftFFT = False
108
108
109 ippSeconds = None
109 ippSeconds = None
110
110
111 timeInterval = None
111 timeInterval = None
112
112
113 nCohInt = None
113 nCohInt = None
114
114
115 noise = None
115 noise = None
116
116
117 windowOfFilter = 1
117 windowOfFilter = 1
118
118
119 #Speed of ligth
119 #Speed of ligth
120 C = 3e8
120 C = 3e8
121
121
122 frequency = 49.92e6
122 frequency = 49.92e6
123
123
124 realtime = False
124 realtime = False
125
125
126 beacon_heiIndexList = None
126 beacon_heiIndexList = None
127
127
128 last_block = None
128 last_block = None
129
129
130 blocknow = None
130 blocknow = None
131
131
132 def __init__(self):
132 def __init__(self):
133
133
134 raise ValueError, "This class has not been implemented"
134 raise ValueError, "This class has not been implemented"
135
135
136 def copy(self, inputObj=None):
136 def copy(self, inputObj=None):
137
137
138 if inputObj == None:
138 if inputObj == None:
139 return copy.deepcopy(self)
139 return copy.deepcopy(self)
140
140
141 for key in inputObj.__dict__.keys():
141 for key in inputObj.__dict__.keys():
142 self.__dict__[key] = inputObj.__dict__[key]
142 self.__dict__[key] = inputObj.__dict__[key]
143
143
144 def deepcopy(self):
144 def deepcopy(self):
145
145
146 return copy.deepcopy(self)
146 return copy.deepcopy(self)
147
147
148 def isEmpty(self):
148 def isEmpty(self):
149
149
150 return self.flagNoData
150 return self.flagNoData
151
151
152 def getNoise(self):
152 def getNoise(self):
153
153
154 raise ValueError, "Not implemented"
154 raise ValueError, "Not implemented"
155
155
156 def getNChannels(self):
156 def getNChannels(self):
157
157
158 return len(self.channelList)
158 return len(self.channelList)
159
159
160 def getChannelIndexList(self):
160 def getChannelIndexList(self):
161
161
162 return range(self.nChannels)
162 return range(self.nChannels)
163
163
164 def getNHeights(self):
164 def getNHeights(self):
165
165
166 return len(self.heightList)
166 return len(self.heightList)
167
167
168 def getHeiRange(self, extrapoints=0):
168 def getHeiRange(self, extrapoints=0):
169
169
170 heis = self.heightList
170 heis = self.heightList
171 # deltah = self.heightList[1] - self.heightList[0]
171 # deltah = self.heightList[1] - self.heightList[0]
172 #
172 #
173 # heis.append(self.heightList[-1])
173 # heis.append(self.heightList[-1])
174
174
175 return heis
175 return heis
176
176
177 def getltctime(self):
177 def getltctime(self):
178
178
179 if self.useLocalTime:
179 if self.useLocalTime:
180 return self.utctime - self.timeZone*60
180 return self.utctime - self.timeZone*60
181
181
182 return self.utctime
182 return self.utctime
183
183
184 def getDatatime(self):
184 def getDatatime(self):
185
185
186 datatime = datetime.datetime.utcfromtimestamp(self.ltctime)
186 datatime = datetime.datetime.utcfromtimestamp(self.ltctime)
187 return datatime
187 return datatime
188
188
189 def getTimeRange(self):
189 def getTimeRange(self):
190
190
191 datatime = []
191 datatime = []
192
192
193 datatime.append(self.ltctime)
193 datatime.append(self.ltctime)
194 datatime.append(self.ltctime + self.timeInterval)
194 datatime.append(self.ltctime + self.timeInterval)
195
195
196 datatime = numpy.array(datatime)
196 datatime = numpy.array(datatime)
197
197
198 return datatime
198 return datatime
199
199
200 def getFmax(self):
200 def getFmax(self):
201
201
202 PRF = 1./(self.ippSeconds * self.nCohInt)
202 PRF = 1./(self.ippSeconds * self.nCohInt)
203
203
204 fmax = PRF/2.
204 fmax = PRF/2.
205
205
206 return fmax
206 return fmax
207
207
208 def getVmax(self):
208 def getVmax(self):
209
209
210 _lambda = self.C/self.frequency
210 _lambda = self.C/self.frequency
211
211
212 vmax = self.getFmax() * _lambda
212 vmax = self.getFmax() * _lambda
213
213
214 return vmax
214 return vmax
215
215
216 nChannels = property(getNChannels, "I'm the 'nChannel' property.")
216 nChannels = property(getNChannels, "I'm the 'nChannel' property.")
217 channelIndexList = property(getChannelIndexList, "I'm the 'channelIndexList' property.")
217 channelIndexList = property(getChannelIndexList, "I'm the 'channelIndexList' property.")
218 nHeights = property(getNHeights, "I'm the 'nHeights' property.")
218 nHeights = property(getNHeights, "I'm the 'nHeights' property.")
219 noise = property(getNoise, "I'm the 'nHeights' property.")
219 noise = property(getNoise, "I'm the 'nHeights' property.")
220 datatime = property(getDatatime, "I'm the 'datatime' property")
220 datatime = property(getDatatime, "I'm the 'datatime' property")
221 ltctime = property(getltctime, "I'm the 'ltctime' property")
221 ltctime = property(getltctime, "I'm the 'ltctime' property")
222
222
223 class Voltage(JROData):
223 class Voltage(JROData):
224
224
225 #data es un numpy array de 2 dmensiones (canales, alturas)
225 #data es un numpy array de 2 dmensiones (canales, alturas)
226 data = None
226 data = None
227
227
228 def __init__(self):
228 def __init__(self):
229 '''
229 '''
230 Constructor
230 Constructor
231 '''
231 '''
232
232
233 self.radarControllerHeaderObj = RadarControllerHeader()
233 self.radarControllerHeaderObj = RadarControllerHeader()
234
234
235 self.systemHeaderObj = SystemHeader()
235 self.systemHeaderObj = SystemHeader()
236
236
237 self.type = "Voltage"
237 self.type = "Voltage"
238
238
239 self.data = None
239 self.data = None
240
240
241 self.dtype = None
241 self.dtype = None
242
242
243 # self.nChannels = 0
243 # self.nChannels = 0
244
244
245 # self.nHeights = 0
245 # self.nHeights = 0
246
246
247 self.nProfiles = None
247 self.nProfiles = None
248
248
249 self.heightList = None
249 self.heightList = None
250
250
251 self.channelList = None
251 self.channelList = None
252
252
253 # self.channelIndexList = None
253 # self.channelIndexList = None
254
254
255 self.flagNoData = True
255 self.flagNoData = True
256
256
257 self.flagTimeBlock = False
257 self.flagTimeBlock = False
258
258
259 self.utctime = None
259 self.utctime = None
260
260
261 self.timeZone = None
261 self.timeZone = None
262
262
263 self.dstFlag = None
263 self.dstFlag = None
264
264
265 self.errorCount = None
265 self.errorCount = None
266
266
267 self.nCohInt = None
267 self.nCohInt = None
268
268
269 self.blocksize = None
269 self.blocksize = None
270
270
271 self.flagDecodeData = False #asumo q la data no esta decodificada
271 self.flagDecodeData = False #asumo q la data no esta decodificada
272
272
273 self.flagDeflipData = False #asumo q la data no esta sin flip
273 self.flagDeflipData = False #asumo q la data no esta sin flip
274
274
275 self.flagShiftFFT = False
275 self.flagShiftFFT = False
276
276
277
277
278 def getNoisebyHildebrand(self):
278 def getNoisebyHildebrand(self):
279 """
279 """
280 Determino el nivel de ruido usando el metodo Hildebrand-Sekhon
280 Determino el nivel de ruido usando el metodo Hildebrand-Sekhon
281
281
282 Return:
282 Return:
283 noiselevel
283 noiselevel
284 """
284 """
285
285
286 for channel in range(self.nChannels):
286 for channel in range(self.nChannels):
287 daux = self.data_spc[channel,:,:]
287 daux = self.data_spc[channel,:,:]
288 self.noise[channel] = hildebrand_sekhon(daux, self.nCohInt)
288 self.noise[channel] = hildebrand_sekhon(daux, self.nCohInt)
289
289
290 return self.noise
290 return self.noise
291
291
292 def getNoise(self, type = 1):
292 def getNoise(self, type = 1):
293
293
294 self.noise = numpy.zeros(self.nChannels)
294 self.noise = numpy.zeros(self.nChannels)
295
295
296 if type == 1:
296 if type == 1:
297 noise = self.getNoisebyHildebrand()
297 noise = self.getNoisebyHildebrand()
298
298
299 return 10*numpy.log10(noise)
299 return 10*numpy.log10(noise)
300
300
301 class Spectra(JROData):
301 class Spectra(JROData):
302
302
303 #data es un numpy array de 2 dmensiones (canales, perfiles, alturas)
303 #data es un numpy array de 2 dmensiones (canales, perfiles, alturas)
304 data_spc = None
304 data_spc = None
305
305
306 #data es un numpy array de 2 dmensiones (canales, pares, alturas)
306 #data es un numpy array de 2 dmensiones (canales, pares, alturas)
307 data_cspc = None
307 data_cspc = None
308
308
309 #data es un numpy array de 2 dmensiones (canales, alturas)
309 #data es un numpy array de 2 dmensiones (canales, alturas)
310 data_dc = None
310 data_dc = None
311
311
312 nFFTPoints = None
312 nFFTPoints = None
313
313
314 nPairs = None
314 nPairs = None
315
315
316 pairsList = None
316 pairsList = None
317
317
318 nIncohInt = None
318 nIncohInt = None
319
319
320 wavelength = None #Necesario para cacular el rango de velocidad desde la frecuencia
320 wavelength = None #Necesario para cacular el rango de velocidad desde la frecuencia
321
321
322 nCohInt = None #se requiere para determinar el valor de timeInterval
322 nCohInt = None #se requiere para determinar el valor de timeInterval
323
323
324 ippFactor = None
324 ippFactor = None
325
325
326 def __init__(self):
326 def __init__(self):
327 '''
327 '''
328 Constructor
328 Constructor
329 '''
329 '''
330
330
331 self.radarControllerHeaderObj = RadarControllerHeader()
331 self.radarControllerHeaderObj = RadarControllerHeader()
332
332
333 self.systemHeaderObj = SystemHeader()
333 self.systemHeaderObj = SystemHeader()
334
334
335 self.type = "Spectra"
335 self.type = "Spectra"
336
336
337 # self.data = None
337 # self.data = None
338
338
339 self.dtype = None
339 self.dtype = None
340
340
341 # self.nChannels = 0
341 # self.nChannels = 0
342
342
343 # self.nHeights = 0
343 # self.nHeights = 0
344
344
345 self.nProfiles = None
345 self.nProfiles = None
346
346
347 self.heightList = None
347 self.heightList = None
348
348
349 self.channelList = None
349 self.channelList = None
350
350
351 # self.channelIndexList = None
351 # self.channelIndexList = None
352
352
353 self.flagNoData = True
353 self.flagNoData = True
354
354
355 self.flagTimeBlock = False
355 self.flagTimeBlock = False
356
356
357 self.utctime = None
357 self.utctime = None
358
358
359 self.nCohInt = None
359 self.nCohInt = None
360
360
361 self.nIncohInt = None
361 self.nIncohInt = None
362
362
363 self.blocksize = None
363 self.blocksize = None
364
364
365 self.nFFTPoints = None
365 self.nFFTPoints = None
366
366
367 self.wavelength = None
367 self.wavelength = None
368
368
369 self.flagDecodeData = False #asumo q la data no esta decodificada
369 self.flagDecodeData = False #asumo q la data no esta decodificada
370
370
371 self.flagDeflipData = False #asumo q la data no esta sin flip
371 self.flagDeflipData = False #asumo q la data no esta sin flip
372
372
373 self.flagShiftFFT = False
373 self.flagShiftFFT = False
374
374
375 self.ippFactor = 1
375 self.ippFactor = 1
376
376
377 self.noise = None
377 self.noise = None
378
378
379 self.beacon_heiIndexList = []
379 self.beacon_heiIndexList = []
380
380
381
381
382 def getNoisebyHildebrand(self):
382 def getNoisebyHildebrand(self):
383 """
383 """
384 Determino el nivel de ruido usando el metodo Hildebrand-Sekhon
384 Determino el nivel de ruido usando el metodo Hildebrand-Sekhon
385
385
386 Return:
386 Return:
387 noiselevel
387 noiselevel
388 """
388 """
389 noise = numpy.zeros(self.nChannels)
389 noise = numpy.zeros(self.nChannels)
390 for channel in range(self.nChannels):
390 for channel in range(self.nChannels):
391 daux = self.data_spc[channel,:,:]
391 daux = self.data_spc[channel,:,:]
392 noise[channel] = hildebrand_sekhon(daux, self.nIncohInt)
392 noise[channel] = hildebrand_sekhon(daux, self.nIncohInt)
393
393
394 return noise
394 return noise
395
395
396 def getNoise(self):
396 def getNoise(self):
397 if self.noise != None:
397 if self.noise != None:
398 return self.noise
398 return self.noise
399 else:
399 else:
400 noise = self.getNoisebyHildebrand()
400 noise = self.getNoisebyHildebrand()
401 return noise
401 return noise
402
402
403
403
404 def getFreqRange(self, extrapoints=0):
404 def getFreqRange(self, extrapoints=0):
405
405
406 deltafreq = self.getFmax() / (self.nFFTPoints*self.ippFactor)
406 deltafreq = self.getFmax() / (self.nFFTPoints*self.ippFactor)
407 freqrange = deltafreq*(numpy.arange(self.nFFTPoints+extrapoints)-self.nFFTPoints/2.) - deltafreq/2
407 freqrange = deltafreq*(numpy.arange(self.nFFTPoints+extrapoints)-self.nFFTPoints/2.) - deltafreq/2
408
408
409 return freqrange
409 return freqrange
410
410
411 def getVelRange(self, extrapoints=0):
411 def getVelRange(self, extrapoints=0):
412
412
413 deltav = self.getVmax() / (self.nFFTPoints*self.ippFactor)
413 deltav = self.getVmax() / (self.nFFTPoints*self.ippFactor)
414 velrange = deltav*(numpy.arange(self.nFFTPoints+extrapoints)-self.nFFTPoints/2.) - deltav/2
414 velrange = deltav*(numpy.arange(self.nFFTPoints+extrapoints)-self.nFFTPoints/2.) - deltav/2
415
415
416 return velrange
416 return velrange
417
417
418 def getNPairs(self):
418 def getNPairs(self):
419
419
420 return len(self.pairsList)
420 return len(self.pairsList)
421
421
422 def getPairsIndexList(self):
422 def getPairsIndexList(self):
423
423
424 return range(self.nPairs)
424 return range(self.nPairs)
425
425
426 def getNormFactor(self):
426 def getNormFactor(self):
427 pwcode = 1
427 pwcode = 1
428 if self.flagDecodeData:
428 if self.flagDecodeData:
429 pwcode = numpy.sum(self.code[0]**2)
429 pwcode = numpy.sum(self.code[0]**2)
430 #normFactor = min(self.nFFTPoints,self.nProfiles)*self.nIncohInt*self.nCohInt*pwcode*self.windowOfFilter
430 #normFactor = min(self.nFFTPoints,self.nProfiles)*self.nIncohInt*self.nCohInt*pwcode*self.windowOfFilter
431 normFactor = self.nProfiles*self.nIncohInt*self.nCohInt*pwcode*self.windowOfFilter
431 normFactor = self.nProfiles*self.nIncohInt*self.nCohInt*pwcode*self.windowOfFilter
432
432
433 return normFactor
433 return normFactor
434
434
435 def getFlagCspc(self):
435 def getFlagCspc(self):
436
436
437 if self.data_cspc == None:
437 if self.data_cspc == None:
438 return True
438 return True
439
439
440 return False
440 return False
441
441
442 def getFlagDc(self):
442 def getFlagDc(self):
443
443
444 if self.data_dc == None:
444 if self.data_dc == None:
445 return True
445 return True
446
446
447 return False
447 return False
448
448
449 nPairs = property(getNPairs, "I'm the 'nPairs' property.")
449 nPairs = property(getNPairs, "I'm the 'nPairs' property.")
450 pairsIndexList = property(getPairsIndexList, "I'm the 'pairsIndexList' property.")
450 pairsIndexList = property(getPairsIndexList, "I'm the 'pairsIndexList' property.")
451 normFactor = property(getNormFactor, "I'm the 'getNormFactor' property.")
451 normFactor = property(getNormFactor, "I'm the 'getNormFactor' property.")
452 flag_cspc = property(getFlagCspc)
452 flag_cspc = property(getFlagCspc)
453 flag_dc = property(getFlagDc)
453 flag_dc = property(getFlagDc)
454
454
455 class SpectraHeis(JROData):
455 class SpectraHeis(JROData):
456
456
457 data_spc = None
457 data_spc = None
458
458
459 data_cspc = None
459 data_cspc = None
460
460
461 data_dc = None
461 data_dc = None
462
462
463 nFFTPoints = None
463 nFFTPoints = None
464
464
465 nPairs = None
465 nPairs = None
466
466
467 pairsList = None
467 pairsList = None
468
468
469 nIncohInt = None
469 nIncohInt = None
470
470
471 def __init__(self):
471 def __init__(self):
472
472
473 self.radarControllerHeaderObj = RadarControllerHeader()
473 self.radarControllerHeaderObj = RadarControllerHeader()
474
474
475 self.systemHeaderObj = SystemHeader()
475 self.systemHeaderObj = SystemHeader()
476
476
477 self.type = "SpectraHeis"
477 self.type = "SpectraHeis"
478
478
479 self.dtype = None
479 self.dtype = None
480
480
481 # self.nChannels = 0
481 # self.nChannels = 0
482
482
483 # self.nHeights = 0
483 # self.nHeights = 0
484
484
485 self.nProfiles = None
485 self.nProfiles = None
486
486
487 self.heightList = None
487 self.heightList = None
488
488
489 self.channelList = None
489 self.channelList = None
490
490
491 # self.channelIndexList = None
491 # self.channelIndexList = None
492
492
493 self.flagNoData = True
493 self.flagNoData = True
494
494
495 self.flagTimeBlock = False
495 self.flagTimeBlock = False
496
496
497 self.nPairs = 0
497 self.nPairs = 0
498
498
499 self.utctime = None
499 self.utctime = None
500
500
501 self.blocksize = None
501 self.blocksize = None
502
502
503 class Fits:
503 class Fits:
504
504
505 heightList = None
505 heightList = None
506
506
507 channelList = None
507 channelList = None
508
508
509 flagNoData = True
509 flagNoData = True
510
510
511 flagTimeBlock = False
511 flagTimeBlock = False
512
512
513 useLocalTime = False
513 useLocalTime = False
514
514
515 utctime = None
515 utctime = None
516
516
517 timeZone = None
517 timeZone = None
518
518
519 ippSeconds = None
519 ippSeconds = None
520
520
521 timeInterval = None
521 timeInterval = None
522
522
523 nCohInt = None
523 nCohInt = None
524
524
525 nIncohInt = None
525 nIncohInt = None
526
526
527 noise = None
527 noise = None
528
528
529 windowOfFilter = 1
529 windowOfFilter = 1
530
530
531 #Speed of ligth
531 #Speed of ligth
532 C = 3e8
532 C = 3e8
533
533
534 frequency = 49.92e6
534 frequency = 49.92e6
535
535
536 realtime = False
536 realtime = False
537
537
538
538
539 def __init__(self):
539 def __init__(self):
540
540
541 self.type = "Fits"
541 self.type = "Fits"
542
542
543 self.nProfiles = None
543 self.nProfiles = None
544
544
545 self.heightList = None
545 self.heightList = None
546
546
547 self.channelList = None
547 self.channelList = None
548
548
549 # self.channelIndexList = None
549 # self.channelIndexList = None
550
550
551 self.flagNoData = True
551 self.flagNoData = True
552
552
553 self.utctime = None
553 self.utctime = None
554
554
555 self.nCohInt = None
555 self.nCohInt = None
556
556
557 self.nIncohInt = None
557 self.nIncohInt = None
558
558
559 self.useLocalTime = True
559 self.useLocalTime = True
560
560
561 # self.utctime = None
561 # self.utctime = None
562 # self.timeZone = None
562 # self.timeZone = None
563 # self.ltctime = None
563 # self.ltctime = None
564 # self.timeInterval = None
564 # self.timeInterval = None
565 # self.header = None
565 # self.header = None
566 # self.data_header = None
566 # self.data_header = None
567 # self.data = None
567 # self.data = None
568 # self.datatime = None
568 # self.datatime = None
569 # self.flagNoData = False
569 # self.flagNoData = False
570 # self.expName = ''
570 # self.expName = ''
571 # self.nChannels = None
571 # self.nChannels = None
572 # self.nSamples = None
572 # self.nSamples = None
573 # self.dataBlocksPerFile = None
573 # self.dataBlocksPerFile = None
574 # self.comments = ''
574 # self.comments = ''
575 #
575 #
576
576
577
577
578 def getltctime(self):
578 def getltctime(self):
579
579
580 if self.useLocalTime:
580 if self.useLocalTime:
581 return self.utctime - self.timeZone*60
581 return self.utctime - self.timeZone*60
582
582
583 return self.utctime
583 return self.utctime
584
584
585 def getDatatime(self):
585 def getDatatime(self):
586
586
587 datatime = datetime.datetime.utcfromtimestamp(self.ltctime)
587 datatime = datetime.datetime.utcfromtimestamp(self.ltctime)
588 return datatime
588 return datatime
589
589
590 def getTimeRange(self):
590 def getTimeRange(self):
591
591
592 datatime = []
592 datatime = []
593
593
594 datatime.append(self.ltctime)
594 datatime.append(self.ltctime)
595 datatime.append(self.ltctime + self.timeInterval)
595 datatime.append(self.ltctime + self.timeInterval)
596
596
597 datatime = numpy.array(datatime)
597 datatime = numpy.array(datatime)
598
598
599 return datatime
599 return datatime
600
600
601 def getHeiRange(self):
601 def getHeiRange(self):
602
602
603 heis = self.heightList
603 heis = self.heightList
604
604
605 return heis
605 return heis
606
606
607 def isEmpty(self):
607 def isEmpty(self):
608
608
609 return self.flagNoData
609 return self.flagNoData
610
610
611 def getNHeights(self):
611 def getNHeights(self):
612
612
613 return len(self.heightList)
613 return len(self.heightList)
614
614
615 def getNChannels(self):
615 def getNChannels(self):
616
616
617 return len(self.channelList)
617 return len(self.channelList)
618
618
619 def getChannelIndexList(self):
619 def getChannelIndexList(self):
620
620
621 return range(self.nChannels)
621 return range(self.nChannels)
622
622
623 def getNoise(self, type = 1):
623 def getNoise(self, type = 1):
624
624
625 self.noise = numpy.zeros(self.nChannels)
625 self.noise = numpy.zeros(self.nChannels)
626
626
627 if type == 1:
627 if type == 1:
628 noise = self.getNoisebyHildebrand()
628 noise = self.getNoisebyHildebrand()
629
629
630 if type == 2:
630 if type == 2:
631 noise = self.getNoisebySort()
631 noise = self.getNoisebySort()
632
632
633 if type == 3:
633 if type == 3:
634 noise = self.getNoisebyWindow()
634 noise = self.getNoisebyWindow()
635
635
636 return noise
636 return noise
637
637
638 datatime = property(getDatatime, "I'm the 'datatime' property")
638 datatime = property(getDatatime, "I'm the 'datatime' property")
639 nHeights = property(getNHeights, "I'm the 'nHeights' property.")
639 nHeights = property(getNHeights, "I'm the 'nHeights' property.")
640 nChannels = property(getNChannels, "I'm the 'nChannel' property.")
640 nChannels = property(getNChannels, "I'm the 'nChannel' property.")
641 channelIndexList = property(getChannelIndexList, "I'm the 'channelIndexList' property.")
641 channelIndexList = property(getChannelIndexList, "I'm the 'channelIndexList' property.")
642 noise = property(getNoise, "I'm the 'nHeights' property.")
642 noise = property(getNoise, "I'm the 'nHeights' property.")
643 datatime = property(getDatatime, "I'm the 'datatime' property")
643 datatime = property(getDatatime, "I'm the 'datatime' property")
644 ltctime = property(getltctime, "I'm the 'ltctime' property")
644 ltctime = property(getltctime, "I'm the 'ltctime' property")
645
645
646 ltctime = property(getltctime, "I'm the 'ltctime' property")
646 ltctime = property(getltctime, "I'm the 'ltctime' property")
647
647
648 class AMISR:
648 class AMISR:
649 def __init__(self):
649 def __init__(self):
650 self.flagNoData = True
650 self.flagNoData = True
651 self.data = None
651 self.data = None
652 self.utctime = None
652 self.utctime = None
653 self.type = "AMISR"
653 self.type = "AMISR"
654
654
655 #propiedades para compatibilidad con Voltages
655 #propiedades para compatibilidad con Voltages
656 self.timeZone = 0#timezone like jroheader, difference in minutes between UTC and localtime
656 self.timeZone = 0#timezone like jroheader, difference in minutes between UTC and localtime
657 self.dstFlag = 0#self.dataIn.dstFlag
657 self.dstFlag = 0#self.dataIn.dstFlag
658 self.errorCount = 0#self.dataIn.errorCount
658 self.errorCount = 0#self.dataIn.errorCount
659 self.useLocalTime = True#self.dataIn.useLocalTime
659 self.useLocalTime = True#self.dataIn.useLocalTime
660
660
661 self.radarControllerHeaderObj = None#self.dataIn.radarControllerHeaderObj.copy()
661 self.radarControllerHeaderObj = None#self.dataIn.radarControllerHeaderObj.copy()
662 self.systemHeaderObj = None#self.dataIn.systemHeaderObj.copy()
662 self.systemHeaderObj = None#self.dataIn.systemHeaderObj.copy()
663 self.channelList = [0]#self.dataIn.channelList esto solo aplica para el caso de AMISR
663 self.channelList = [0]#self.dataIn.channelList esto solo aplica para el caso de AMISR
664 self.dtype = numpy.dtype([('real','<f4'),('imag','<f4')])
664 self.dtype = numpy.dtype([('real','<f4'),('imag','<f4')])
665
665
666 self.flagTimeBlock = None#self.dataIn.flagTimeBlock
666 self.flagTimeBlock = None#self.dataIn.flagTimeBlock
667 #self.utctime = #self.firstdatatime
667 #self.utctime = #self.firstdatatime
668 self.flagDecodeData = None#self.dataIn.flagDecodeData #asumo q la data esta decodificada
668 self.flagDecodeData = None#self.dataIn.flagDecodeData #asumo q la data esta decodificada
669 self.flagDeflipData = None#self.dataIn.flagDeflipData #asumo q la data esta sin flip
669 self.flagDeflipData = None#self.dataIn.flagDeflipData #asumo q la data esta sin flip
670
670
671 self.nCohInt = 1#self.dataIn.nCohInt
671 self.nCohInt = 1#self.dataIn.nCohInt
672 self.nIncohInt = 1
672 self.nIncohInt = 1
673 self.ippSeconds = 0.004#self.dataIn.ippSeconds, segun el filename/Setup/Tufile
673 self.ippSeconds = None#self.dataIn.ippSeconds, segun el filename/Setup/Tufile
674 self.windowOfFilter = None#self.dataIn.windowOfFilter
674 self.windowOfFilter = None#self.dataIn.windowOfFilter
675
675
676 self.timeInterval = None#self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nIncohInt
676 self.timeInterval = None#self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nIncohInt
677 self.frequency = 20000000#self.dataIn.frequency
677 self.frequency = None#self.dataIn.frequency
678 self.realtime = 0#self.dataIn.realtime
678 self.realtime = 0#self.dataIn.realtime
679
679
680 #actualizar en la lectura de datos
680 #actualizar en la lectura de datos
681 self.heightList = None#self.dataIn.heightList
681 self.heightList = None#self.dataIn.heightList
682 self.nProfiles = None#self.dataOut.nFFTPoints
682 self.nProfiles = None#self.dataOut.nFFTPoints
683 self.nBaud = None#self.dataIn.nBaud
683 self.nBaud = None#self.dataIn.nBaud
684 self.nCode = None#self.dataIn.nCode
684 self.nCode = None#self.dataIn.nCode
685 self.code = None#self.dataIn.code
685 self.code = None#self.dataIn.code
686
686
687 #consideracion para los Beams
687 #consideracion para los Beams
688 self.beamCodeDict = None
688 self.beamCodeDict = None
689 self.beamRangeDict = None
689 self.beamRangeDict = None
690
690
691 def copy(self, inputObj=None):
691 def copy(self, inputObj=None):
692
692
693 if inputObj == None:
693 if inputObj == None:
694 return copy.deepcopy(self)
694 return copy.deepcopy(self)
695
695
696 for key in inputObj.__dict__.keys():
696 for key in inputObj.__dict__.keys():
697 self.__dict__[key] = inputObj.__dict__[key]
697 self.__dict__[key] = inputObj.__dict__[key]
698
698
699
699
700 def isEmpty(self):
700 def isEmpty(self):
701
701
702 return self.flagNoData No newline at end of file
702 return self.flagNoData
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,287 +1,326
1 import os, sys
1 import os, sys
2
2
3 path = os.path.split(os.getcwd())[0]
3 path = os.path.split(os.getcwd())[0]
4 sys.path.append(path)
4 sys.path.append(path)
5
5
6 from controller import *
6 from controller import *
7
7
8 desc = "AMISR Experiment Test"
8 desc = "AMISR Experiment Test"
9 filename = "amisr.xml"
9 filename = "amisr.xml"
10
10
11 controllerObj = Project()
11 controllerObj = Project()
12
12
13 controllerObj.setup(id = '191', name='test01', description=desc)
13 controllerObj.setup(id = '191', name='test01', description=desc)
14
14
15 path = '/home/administrator/Documents/amisr'
15 path = '/home/administrator/Documents/amisr'
16 path = '/media/administrator/New Volume/amisr'
16 path = '/media/administrator/New Volume/amisr'
17
17
18 figpath = '/home/administrator/Pictures/amisr'
18 figpath = '/home/administrator/Pictures/amisr'
19
19
20 figfile0 = 'amisr_rti_beam0.png'
20 figfile0 = 'amisr_rti_beam0.png'
21 figfile1 = 'amisr_rti_beam1.png'
21 figfile1 = 'amisr_rti_beam1.png'
22 figfile2 = 'amisr_rti_beam2.png'
22 figfile2 = 'amisr_rti_beam2.png'
23 figfile3 = 'amisr_rti_beam3.png'
23 figfile3 = 'amisr_rti_beam3.png'
24 figfile4 = 'amisr_rti_beam4.png'
24 figfile4 = 'amisr_rti_beam4.png'
25 figfile5 = 'amisr_rti_beam5.png'
25 figfile5 = 'amisr_rti_beam5.png'
26 figfile6 = 'amisr_rti_beam6.png'
26 figfile6 = 'amisr_rti_beam6.png'
27
27
28 title0 = 'RTI AMISR Beam 0'
28 title0 = 'RTI AMISR Beam 0'
29 title1 = 'RTI AMISR Beam 1'
29 title1 = 'RTI AMISR Beam 1'
30 title2 = 'RTI AMISR Beam 2'
30 title2 = 'RTI AMISR Beam 2'
31 title3 = 'RTI AMISR Beam 3'
31 title3 = 'RTI AMISR Beam 3'
32 title4 = 'RTI AMISR Beam 4'
32 title4 = 'RTI AMISR Beam 4'
33 title5 = 'RTI AMISR Beam 5'
33 title5 = 'RTI AMISR Beam 5'
34 title6 = 'RTI AMISR Beam 6'
34 title6 = 'RTI AMISR Beam 6'
35
35
36 profileStrSelBeam0 = '0,101'
37 profileStrSelBeam1 = '614,741'
38 profileStrSelBeam2 = '358,485'
39 profileStrSelBeam3 = '742,869'
40 profileStrSelBeam4 = '230,357'
41 profileStrSelBeam5 = '486,613'
42 profileStrSelBeam6 = '102,229'
43
36 readUnitConfObj = controllerObj.addReadUnit(datatype='AMISR',
44 readUnitConfObj = controllerObj.addReadUnit(datatype='AMISR',
37 path=path,
45 path=path,
38 startDate='2014/08/19',
46 startDate='2014/08/20',
39 endDate='2014/08/19',
47 endDate='2014/08/20',
40 startTime='00:00:00',
48 startTime='00:00:00',
41 endTime='23:59:59',
49 endTime='23:59:59',
42 walk=1)
50 walk=1)
43
51
44 procUnitConfObjBeam0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
45 procUnitConfObjBeam1 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
46 procUnitConfObjBeam2 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
47 procUnitConfObjBeam3 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
48 procUnitConfObjBeam4 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
49 procUnitConfObjBeam5 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
50 procUnitConfObjBeam6 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
51
52
53
54
52
55 ############################# Beam0 #############################
56 opObj11 = procUnitConfObjBeam0.addOperation(name='ProfileSelector', optype='other')
57 opObj11.addParameter(name='profileRangeList', value='0,81', format='intlist')
58
59 opObj11 = procUnitConfObjBeam0.addOperation(name='CohInt', optype='other')
60 opObj11.addParameter(name='n', value='82', format='int')
61
62 procUnitConfObjSpectraBeam0 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam0.getId())
63 procUnitConfObjSpectraBeam0.addParameter(name='nFFTPoints', value='32', format='int')
64 procUnitConfObjSpectraBeam0.addParameter(name='nProfiles', value='32', format='int')
65
66 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='getNoise')
67 opObj11.addParameter(name='minHei', value='100', format='float')
68 opObj11.addParameter(name='maxHei', value='450', format='float')
69
70 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='RTIPlot', optype='other')
71 opObj11.addParameter(name='id', value='200', format='int')
72 opObj11.addParameter(name='wintitle', value=title0, format='str')
73 opObj11.addParameter(name='xmin', value='0', format='int')
74 opObj11.addParameter(name='xmax', value='18', format='int')
75 opObj11.addParameter(name='zmin', value='45', format='int')
76 opObj11.addParameter(name='zmax', value='70', format='int')
77 #opObj11.addParameter(name='timerange', value='7200', format='int')
78 opObj11.addParameter(name='showprofile', value='0', format='int')
79 opObj11.addParameter(name='figpath', value=figpath, format='str')
80 opObj11.addParameter(name='figfile', value=figfile0, format='str')
81
53
54 # procUnitConfObjBeam0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
55 # opObj11 = procUnitConfObjBeam0.addOperation(name='ProfileSelector', optype='other')
56 # opObj11.addParameter(name='profileRangeList', value=profileStrSelBeam0, format='intlist')
82
57
58 # procUnitConfObjBeam1 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
59 # procUnitConfObjBeam2 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
60 # procUnitConfObjBeam3 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
61 # procUnitConfObjBeam4 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
62 # procUnitConfObjBeam5 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
63 # procUnitConfObjBeam6 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
83
64
65 procUnitAMISR = controllerObj.addProcUnit(datatype='AMISR', inputId=readUnitConfObj.getId())
66 opObj11 = procUnitAMISR.addOperation(name='BeamSelector', optype='other')
67 opObj11.addParameter(name='beam', value='1', format='int')
84
68
69 procUnitConfObjBeam1 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitAMISR.getId())
85
70
86 #
87 ############################# Beam1 #############################
88 opObj11 = procUnitConfObjBeam1.addOperation(name='ProfileSelector', optype='other')
89 opObj11.addParameter(name='profileRangeList', value='82,209', format='intlist')
90
91 opObj11 = procUnitConfObjBeam1.addOperation(name='CohInt', optype='other')
71 opObj11 = procUnitConfObjBeam1.addOperation(name='CohInt', optype='other')
92 opObj11.addParameter(name='n', value='128', format='int')
72 opObj11.addParameter(name='n', value='128', format='int')
93
73
74
94 procUnitConfObjSpectraBeam1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam1.getId())
75 procUnitConfObjSpectraBeam1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam1.getId())
95 procUnitConfObjSpectraBeam1.addParameter(name='nFFTPoints', value='32', format='int')
76 procUnitConfObjSpectraBeam1.addParameter(name='nFFTPoints', value='32', format='int')
96 procUnitConfObjSpectraBeam1.addParameter(name='nProfiles', value='32', format='int')
77 procUnitConfObjSpectraBeam1.addParameter(name='nProfiles', value='32', format='int')
97
78
98 opObj11 = procUnitConfObjSpectraBeam1.addOperation(name='getNoise')
79 opObj11 = procUnitConfObjSpectraBeam1.addOperation(name='getNoise')
99 opObj11.addParameter(name='minHei', value='100', format='float')
80 opObj11.addParameter(name='minHei', value='100', format='float')
100 opObj11.addParameter(name='maxHei', value='450', format='float')
81 opObj11.addParameter(name='maxHei', value='450', format='float')
101
82
102 #opObj11 = procUnitConfObjSpectraBeam1.addOperation(name='SpectraPlot', optype='other')
83 opObj11 = procUnitConfObjSpectraBeam1.addOperation(name='SpectraPlot', optype='other')
103 #opObj11.addParameter(name='id', value='100', format='int')
84 opObj11.addParameter(name='id', value='100', format='int')
104 #opObj11.addParameter(name='wintitle', value='SpectraPlot', format='str')
85 opObj11.addParameter(name='wintitle', value='SpectraPlot', format='str')
86
87
88
89
90
91
92
93 # ############################# Beam0 #############################
94 # opObj11 = procUnitConfObjBeam0.addOperation(name='ProfileSelector', optype='other')
95 # opObj11.addParameter(name='profileRangeList', value=profileStrSelBeam0, format='intlist')
96 #
97 # opObj11 = procUnitConfObjBeam0.addOperation(name='CohInt', optype='other')
98 # opObj11.addParameter(name='n', value='102', format='int')
99 #
100 # procUnitConfObjSpectraBeam0 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam0.getId())
101 # procUnitConfObjSpectraBeam0.addParameter(name='nFFTPoints', value='32', format='int')
102 # procUnitConfObjSpectraBeam0.addParameter(name='nProfiles', value='32', format='int')
103 #
104 # opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='getNoise')
105 # opObj11.addParameter(name='minHei', value='100', format='float')
106 # opObj11.addParameter(name='maxHei', value='450', format='float')
107 #
108 # opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='RTIPlot', optype='other')
109 # opObj11.addParameter(name='id', value='200', format='int')
110 # opObj11.addParameter(name='wintitle', value=title0, format='str')
111 # opObj11.addParameter(name='xmin', value='0', format='int')
112 # opObj11.addParameter(name='xmax', value='18', format='int')
105 # opObj11.addParameter(name='zmin', value='45', format='int')
113 # opObj11.addParameter(name='zmin', value='45', format='int')
106 # opObj11.addParameter(name='zmax', value='70', format='int')
114 # opObj11.addParameter(name='zmax', value='70', format='int')
107 # opObj11.addParameter(name='save', value='1', format='bool')
115 # #opObj11.addParameter(name='timerange', value='7200', format='int')
108 # opObj11.addParameter(name='figpath', value='/Users/administrator/Pictures/amisr', format='str')
116 # opObj11.addParameter(name='showprofile', value='0', format='int')
109
117 # opObj11.addParameter(name='figpath', value=figpath, format='str')
110 opObj11 = procUnitConfObjSpectraBeam1.addOperation(name='RTIPlot', optype='other')
118 # opObj11.addParameter(name='figfile', value=figfile0, format='str')
111 opObj11.addParameter(name='id', value='201', format='int')
119 #
112 opObj11.addParameter(name='wintitle', value=title1, format='str')
120 #
113 #opObj11.addParameter(name='timerange', value='36000', format='int')
121 #
114 opObj11.addParameter(name='xmin', value='0', format='int')
122 #
115 opObj11.addParameter(name='xmax', value='18', format='int')
123 #
116 opObj11.addParameter(name='zmin', value='45', format='int')
124 # #
117 opObj11.addParameter(name='zmax', value='70', format='int')
125 # ############################# Beam1 #############################
118 opObj11.addParameter(name='showprofile', value='0', format='int')
126 # opObj11 = procUnitConfObjBeam1.addOperation(name='ProfileSelector', optype='other')
119 opObj11.addParameter(name='figpath', value=figpath, format='str')
127 # #opObj11.addParameter(name='profileRangeList', value=profileStrSelBeam1, format='intlist')
120 opObj11.addParameter(name='figfile', value=figfile1, format='str')
128 # opObj11.addParameter(name='beam', value='1', format='int')
121 #
129 #
122 #
130 # opObj11 = procUnitConfObjBeam1.addOperation(name='CohInt', optype='other')
123 #
131 # opObj11.addParameter(name='n', value='128', format='int')
124 #
132 #
125 #
133 # procUnitConfObjSpectraBeam1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam1.getId())
126 ############################## Beam2 #############################
134 # procUnitConfObjSpectraBeam1.addParameter(name='nFFTPoints', value='32', format='int')
127 opObj11 = procUnitConfObjBeam2.addOperation(name='ProfileSelector', optype='other')
135 # procUnitConfObjSpectraBeam1.addParameter(name='nProfiles', value='32', format='int')
128 opObj11.addParameter(name='profileRangeList', value='210,337', format='intlist')
136 #
129
137 # opObj11 = procUnitConfObjSpectraBeam1.addOperation(name='getNoise')
130 opObj11 = procUnitConfObjBeam2.addOperation(name='CohInt', optype='other')
138 # opObj11.addParameter(name='minHei', value='100', format='float')
131 opObj11.addParameter(name='n', value='128', format='int')
139 # opObj11.addParameter(name='maxHei', value='450', format='float')
132
140 #
133 procUnitConfObjSpectraBeam2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam2.getId())
141 # opObj11 = procUnitConfObjSpectraBeam1.addOperation(name='SpectraPlot', optype='other')
134 procUnitConfObjSpectraBeam2.addParameter(name='nFFTPoints', value='32', format='int')
142 # opObj11.addParameter(name='id', value='100', format='int')
135 procUnitConfObjSpectraBeam2.addParameter(name='nProfiles', value='32', format='int')
143 # opObj11.addParameter(name='wintitle', value='SpectraPlot', format='str')
136
144 # # opObj11.addParameter(name='zmin', value='45', format='int')
137 opObj11 = procUnitConfObjSpectraBeam2.addOperation(name='getNoise')
145 # # opObj11.addParameter(name='zmax', value='70', format='int')
138 opObj11.addParameter(name='minHei', value='100', format='float')
146 # # opObj11.addParameter(name='save', value='1', format='bool')
139 opObj11.addParameter(name='maxHei', value='450', format='float')
147 # # opObj11.addParameter(name='figpath', value='/Users/administrator/Pictures/amisr', format='str')
140
148 #
141 opObj11 = procUnitConfObjSpectraBeam2.addOperation(name='RTIPlot', optype='other')
149 # opObj11 = procUnitConfObjSpectraBeam1.addOperation(name='RTIPlot', optype='other')
142 opObj11.addParameter(name='id', value='202', format='int')
150 # opObj11.addParameter(name='id', value='201', format='int')
143 opObj11.addParameter(name='wintitle', value=title2, format='str')
151 # opObj11.addParameter(name='wintitle', value=title1, format='str')
144 #opObj11.addParameter(name='timerange', value='18000', format='int')
152 # #opObj11.addParameter(name='timerange', value='36000', format='int')
145 opObj11.addParameter(name='xmin', value='0', format='int')
153 # opObj11.addParameter(name='xmin', value='0', format='int')
146 opObj11.addParameter(name='xmax', value='18', format='int')
154 # opObj11.addParameter(name='xmax', value='18', format='int')
147 opObj11.addParameter(name='zmin', value='45', format='int')
155 # opObj11.addParameter(name='zmin', value='45', format='int')
148 opObj11.addParameter(name='zmax', value='70', format='int')
156 # opObj11.addParameter(name='zmax', value='70', format='int')
149 opObj11.addParameter(name='showprofile', value='0', format='int')
157 # opObj11.addParameter(name='showprofile', value='0', format='int')
150 opObj11.addParameter(name='figpath', value=figpath, format='str')
158 # opObj11.addParameter(name='figpath', value=figpath, format='str')
151 opObj11.addParameter(name='figfile', value=figfile2, format='str')
159 # opObj11.addParameter(name='figfile', value=figfile1, format='str')
152 # #
153 # #
154 # #
155 # #
156 # #
157 # #
158 ############################## Beam3 #############################
159 opObj11 = procUnitConfObjBeam3.addOperation(name='ProfileSelector', optype='other')
160 opObj11.addParameter(name='profileRangeList', value='338,465', format='intlist')
161
162 opObj11 = procUnitConfObjBeam3.addOperation(name='CohInt', optype='other')
163 opObj11.addParameter(name='n', value='128', format='int')
164
165 procUnitConfObjSpectraBeam3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam3.getId())
166 procUnitConfObjSpectraBeam3.addParameter(name='nFFTPoints', value='32', format='int')
167 procUnitConfObjSpectraBeam3.addParameter(name='nProfiles', value='32', format='int')
168
169 opObj11 = procUnitConfObjSpectraBeam3.addOperation(name='getNoise')
170 opObj11.addParameter(name='minHei', value='100', format='float')
171 opObj11.addParameter(name='maxHei', value='450', format='float')
172
173 opObj11 = procUnitConfObjSpectraBeam3.addOperation(name='RTIPlot', optype='other')
174 opObj11.addParameter(name='id', value='203', format='int')
175 opObj11.addParameter(name='wintitle', value=title3, format='str')
176 #opObj11.addParameter(name='timerange', value='18000', format='int')
177 opObj11.addParameter(name='xmin', value='0', format='int')
178 opObj11.addParameter(name='xmax', value='18', format='int')
179 opObj11.addParameter(name='zmin', value='45', format='int')
180 opObj11.addParameter(name='zmax', value='70', format='int')
181 opObj11.addParameter(name='showprofile', value='0', format='int')
182 opObj11.addParameter(name='figpath', value=figpath, format='str')
183 opObj11.addParameter(name='figfile', value=figfile3, format='str')
184 # #
185 # #
186 # #
187 # #
188 # #
189 # #
190 ############################## Beam4 #############################
191 opObj11 = procUnitConfObjBeam4.addOperation(name='ProfileSelector', optype='other')
192 opObj11.addParameter(name='profileRangeList', value='466,593', format='intlist')
193
194 opObj11 = procUnitConfObjBeam4.addOperation(name='CohInt', optype='other')
195 opObj11.addParameter(name='n', value='128', format='int')
196
197 procUnitConfObjSpectraBeam4 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam4.getId())
198 procUnitConfObjSpectraBeam4.addParameter(name='nFFTPoints', value='32', format='int')
199 procUnitConfObjSpectraBeam4.addParameter(name='nProfiles', value='32', format='int')
200
201 opObj11 = procUnitConfObjSpectraBeam4.addOperation(name='getNoise')
202 opObj11.addParameter(name='minHei', value='100', format='float')
203 opObj11.addParameter(name='maxHei', value='450', format='float')
204
205 opObj11 = procUnitConfObjSpectraBeam4.addOperation(name='RTIPlot', optype='other')
206 opObj11.addParameter(name='id', value='204', format='int')
207 opObj11.addParameter(name='wintitle', value=title4, format='str')
208 #opObj11.addParameter(name='timerange', value='18000', format='int')
209 opObj11.addParameter(name='xmin', value='0', format='int')
210 opObj11.addParameter(name='xmax', value='18', format='int')
211 opObj11.addParameter(name='zmin', value='45', format='int')
212 opObj11.addParameter(name='zmax', value='70', format='int')
213 opObj11.addParameter(name='showprofile', value='0', format='int')
214 opObj11.addParameter(name='figpath', value=figpath, format='str')
215 opObj11.addParameter(name='figfile', value=figfile4, format='str')
216 # #
217 # #
218 # #
219 # #
160 # #
220 # #
221 ############################## Beam5 #############################
222 opObj11 = procUnitConfObjBeam5.addOperation(name='ProfileSelector', optype='other')
223 opObj11.addParameter(name='profileRangeList', value='594,721', format='intlist')
224
225 opObj11 = procUnitConfObjBeam5.addOperation(name='CohInt', optype='other')
226 opObj11.addParameter(name='n', value='128', format='int')
227
228 procUnitConfObjSpectraBeam5 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam5.getId())
229 procUnitConfObjSpectraBeam5.addParameter(name='nFFTPoints', value='32', format='int')
230 procUnitConfObjSpectraBeam5.addParameter(name='nProfiles', value='32', format='int')
231
232 opObj11 = procUnitConfObjSpectraBeam5.addOperation(name='getNoise')
233 opObj11.addParameter(name='minHei', value='100', format='float')
234 opObj11.addParameter(name='maxHei', value='450', format='float')
235
236 opObj11 = procUnitConfObjSpectraBeam5.addOperation(name='RTIPlot', optype='other')
237 opObj11.addParameter(name='id', value='205', format='int')
238 opObj11.addParameter(name='wintitle', value=title5, format='str')
239 #opObj11.addParameter(name='timerange', value='18000', format='int')
240 opObj11.addParameter(name='xmin', value='0', format='int')
241 opObj11.addParameter(name='xmax', value='18', format='int')
242 opObj11.addParameter(name='zmin', value='45', format='int')
243 opObj11.addParameter(name='zmax', value='70', format='int')
244 opObj11.addParameter(name='showprofile', value='0', format='int')
245 opObj11.addParameter(name='figpath', value=figpath, format='str')
246 opObj11.addParameter(name='figfile', value=figfile5, format='str')
247 # #
161 # #
248 # #
162 # #
249 # #
163 # #
250 # #
164 # #
251 # #
165 # ############################## Beam2 #############################
252 ############################## Beam6 #############################
166 # opObj11 = procUnitConfObjBeam2.addOperation(name='ProfileSelector', optype='other')
253 opObj11 = procUnitConfObjBeam6.addOperation(name='ProfileSelector', optype='other')
167 # opObj11.addParameter(name='profileRangeList', value=profileStrSelBeam2, format='intlist')
254 opObj11.addParameter(name='profileRangeList', value='722,849', format='intlist')
168 #
255
169 # opObj11 = procUnitConfObjBeam2.addOperation(name='CohInt', optype='other')
256 opObj11 = procUnitConfObjBeam6.addOperation(name='CohInt', optype='other')
170 # opObj11.addParameter(name='n', value='128', format='int')
257 opObj11.addParameter(name='n', value='128', format='int')
171 #
258
172 # procUnitConfObjSpectraBeam2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam2.getId())
259 procUnitConfObjSpectraBeam6 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam6.getId())
173 # procUnitConfObjSpectraBeam2.addParameter(name='nFFTPoints', value='32', format='int')
260 procUnitConfObjSpectraBeam6.addParameter(name='nFFTPoints', value='32', format='int')
174 # procUnitConfObjSpectraBeam2.addParameter(name='nProfiles', value='32', format='int')
261 procUnitConfObjSpectraBeam6.addParameter(name='nProfiles', value='32', format='int')
175 #
262
176 # opObj11 = procUnitConfObjSpectraBeam2.addOperation(name='getNoise')
263 opObj11 = procUnitConfObjSpectraBeam6.addOperation(name='getNoise')
177 # opObj11.addParameter(name='minHei', value='100', format='float')
264 opObj11.addParameter(name='minHei', value='100', format='float')
178 # opObj11.addParameter(name='maxHei', value='450', format='float')
265 opObj11.addParameter(name='maxHei', value='450', format='float')
179 #
266
180 # opObj11 = procUnitConfObjSpectraBeam2.addOperation(name='RTIPlot', optype='other')
267 opObj11 = procUnitConfObjSpectraBeam6.addOperation(name='RTIPlot', optype='other')
181 # opObj11.addParameter(name='id', value='202', format='int')
268 opObj11.addParameter(name='id', value='206', format='int')
182 # opObj11.addParameter(name='wintitle', value=title2, format='str')
269 opObj11.addParameter(name='wintitle', value=title6, format='str')
183 # #opObj11.addParameter(name='timerange', value='18000', format='int')
270 #opObj11.addParameter(name='timerange', value='18000', format='int')
184 # opObj11.addParameter(name='xmin', value='0', format='int')
271 opObj11.addParameter(name='xmin', value='0', format='int')
185 # opObj11.addParameter(name='xmax', value='18', format='int')
272 opObj11.addParameter(name='xmax', value='18', format='int')
186 # opObj11.addParameter(name='zmin', value='45', format='int')
273 opObj11.addParameter(name='zmin', value='45', format='int')
187 # opObj11.addParameter(name='zmax', value='70', format='int')
274 opObj11.addParameter(name='zmax', value='70', format='int')
188 # opObj11.addParameter(name='showprofile', value='0', format='int')
275 opObj11.addParameter(name='showprofile', value='0', format='int')
189 # opObj11.addParameter(name='figpath', value=figpath, format='str')
276 opObj11.addParameter(name='figpath', value=figpath, format='str')
190 # opObj11.addParameter(name='figfile', value=figfile2, format='str')
277 opObj11.addParameter(name='figfile', value=figfile6, format='str')
191 #
192 #
193 #
194 #
195 #
196 #
197 # ############################## Beam3 #############################
198 # opObj11 = procUnitConfObjBeam3.addOperation(name='ProfileSelector', optype='other')
199 # opObj11.addParameter(name='profileRangeList', value=profileStrSelBeam3, format='intlist')
200 #
201 # opObj11 = procUnitConfObjBeam3.addOperation(name='CohInt', optype='other')
202 # opObj11.addParameter(name='n', value='128', format='int')
203 #
204 # procUnitConfObjSpectraBeam3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam3.getId())
205 # procUnitConfObjSpectraBeam3.addParameter(name='nFFTPoints', value='32', format='int')
206 # procUnitConfObjSpectraBeam3.addParameter(name='nProfiles', value='32', format='int')
207 #
208 # opObj11 = procUnitConfObjSpectraBeam3.addOperation(name='getNoise')
209 # opObj11.addParameter(name='minHei', value='100', format='float')
210 # opObj11.addParameter(name='maxHei', value='450', format='float')
211 #
212 # opObj11 = procUnitConfObjSpectraBeam3.addOperation(name='RTIPlot', optype='other')
213 # opObj11.addParameter(name='id', value='203', format='int')
214 # opObj11.addParameter(name='wintitle', value=title3, format='str')
215 # #opObj11.addParameter(name='timerange', value='18000', format='int')
216 # opObj11.addParameter(name='xmin', value='0', format='int')
217 # opObj11.addParameter(name='xmax', value='18', format='int')
218 # opObj11.addParameter(name='zmin', value='45', format='int')
219 # opObj11.addParameter(name='zmax', value='70', format='int')
220 # opObj11.addParameter(name='showprofile', value='0', format='int')
221 # opObj11.addParameter(name='figpath', value=figpath, format='str')
222 # opObj11.addParameter(name='figfile', value=figfile3, format='str')
223 # # #
224 # # #
225 # # #
226 # # #
227 # # #
228 # # #
229 # ############################## Beam4 #############################
230 # opObj11 = procUnitConfObjBeam4.addOperation(name='ProfileSelector', optype='other')
231 # opObj11.addParameter(name='profileRangeList', value=profileStrSelBeam4, format='intlist')
232 #
233 # opObj11 = procUnitConfObjBeam4.addOperation(name='CohInt', optype='other')
234 # opObj11.addParameter(name='n', value='128', format='int')
235 #
236 # procUnitConfObjSpectraBeam4 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam4.getId())
237 # procUnitConfObjSpectraBeam4.addParameter(name='nFFTPoints', value='32', format='int')
238 # procUnitConfObjSpectraBeam4.addParameter(name='nProfiles', value='32', format='int')
239 #
240 # opObj11 = procUnitConfObjSpectraBeam4.addOperation(name='getNoise')
241 # opObj11.addParameter(name='minHei', value='100', format='float')
242 # opObj11.addParameter(name='maxHei', value='450', format='float')
243 #
244 # opObj11 = procUnitConfObjSpectraBeam4.addOperation(name='RTIPlot', optype='other')
245 # opObj11.addParameter(name='id', value='204', format='int')
246 # opObj11.addParameter(name='wintitle', value=title4, format='str')
247 # #opObj11.addParameter(name='timerange', value='18000', format='int')
248 # opObj11.addParameter(name='xmin', value='0', format='int')
249 # opObj11.addParameter(name='xmax', value='18', format='int')
250 # opObj11.addParameter(name='zmin', value='45', format='int')
251 # opObj11.addParameter(name='zmax', value='70', format='int')
252 # opObj11.addParameter(name='showprofile', value='0', format='int')
253 # opObj11.addParameter(name='figpath', value=figpath, format='str')
254 # opObj11.addParameter(name='figfile', value=figfile4, format='str')
255 # # # #
256 # # # #
257 # # # #
258 # # # #
259 # # # #
260 # ############################## Beam5 #############################
261 # opObj11 = procUnitConfObjBeam5.addOperation(name='ProfileSelector', optype='other')
262 # opObj11.addParameter(name='profileRangeList', value=profileStrSelBeam5, format='intlist')
263 #
264 # opObj11 = procUnitConfObjBeam5.addOperation(name='CohInt', optype='other')
265 # opObj11.addParameter(name='n', value='128', format='int')
266 #
267 # procUnitConfObjSpectraBeam5 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam5.getId())
268 # procUnitConfObjSpectraBeam5.addParameter(name='nFFTPoints', value='32', format='int')
269 # procUnitConfObjSpectraBeam5.addParameter(name='nProfiles', value='32', format='int')
270 #
271 # opObj11 = procUnitConfObjSpectraBeam5.addOperation(name='getNoise')
272 # opObj11.addParameter(name='minHei', value='100', format='float')
273 # opObj11.addParameter(name='maxHei', value='450', format='float')
274 #
275 # opObj11 = procUnitConfObjSpectraBeam5.addOperation(name='RTIPlot', optype='other')
276 # opObj11.addParameter(name='id', value='205', format='int')
277 # opObj11.addParameter(name='wintitle', value=title5, format='str')
278 # #opObj11.addParameter(name='timerange', value='18000', format='int')
279 # opObj11.addParameter(name='xmin', value='0', format='int')
280 # opObj11.addParameter(name='xmax', value='18', format='int')
281 # opObj11.addParameter(name='zmin', value='45', format='int')
282 # opObj11.addParameter(name='zmax', value='70', format='int')
283 # opObj11.addParameter(name='showprofile', value='0', format='int')
284 # opObj11.addParameter(name='figpath', value=figpath, format='str')
285 # opObj11.addParameter(name='figfile', value=figfile5, format='str')
286 # # #
287 # # # #
288 # # # #
289 # # # #
290 # # # #
291 # ############################## Beam6 #############################
292 # opObj11 = procUnitConfObjBeam6.addOperation(name='ProfileSelector', optype='other')
293 # opObj11.addParameter(name='profileRangeList', value=profileStrSelBeam6, format='intlist')
294 #
295 # opObj11 = procUnitConfObjBeam6.addOperation(name='CohInt', optype='other')
296 # opObj11.addParameter(name='n', value='128', format='int')
297 #
298 # procUnitConfObjSpectraBeam6 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObjBeam6.getId())
299 # procUnitConfObjSpectraBeam6.addParameter(name='nFFTPoints', value='32', format='int')
300 # procUnitConfObjSpectraBeam6.addParameter(name='nProfiles', value='32', format='int')
301 #
302 # opObj11 = procUnitConfObjSpectraBeam6.addOperation(name='getNoise')
303 # opObj11.addParameter(name='minHei', value='100', format='float')
304 # opObj11.addParameter(name='maxHei', value='450', format='float')
305 #
306 # opObj11 = procUnitConfObjSpectraBeam6.addOperation(name='RTIPlot', optype='other')
307 # opObj11.addParameter(name='id', value='206', format='int')
308 # opObj11.addParameter(name='wintitle', value=title6, format='str')
309 # #opObj11.addParameter(name='timerange', value='18000', format='int')
310 # opObj11.addParameter(name='xmin', value='0', format='int')
311 # opObj11.addParameter(name='xmax', value='18', format='int')
312 # opObj11.addParameter(name='zmin', value='45', format='int')
313 # opObj11.addParameter(name='zmax', value='70', format='int')
314 # opObj11.addParameter(name='showprofile', value='0', format='int')
315 # opObj11.addParameter(name='figpath', value=figpath, format='str')
316 # opObj11.addParameter(name='figfile', value=figfile6, format='str')
278
317
279
318
280 print "Escribiendo el archivo XML"
319 print "Escribiendo el archivo XML"
281 controllerObj.writeXml(filename)
320 controllerObj.writeXml(filename)
282 print "Leyendo el archivo XML"
321 print "Leyendo el archivo XML"
283 controllerObj.readXml(filename)
322 controllerObj.readXml(filename)
284
323
285 controllerObj.createObjects()
324 controllerObj.createObjects()
286 controllerObj.connectObjects()
325 controllerObj.connectObjects()
287 controllerObj.run()
326 controllerObj.run()
General Comments 0
You need to be logged in to leave comments. Login now