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