##// END OF EJS Templates
pruebas con amisr
joabAM -
r1375:73fc975c20f6
parent child
Show More
@@ -1,661 +1,660
1 1 '''
2 2 Created on Set 9, 2015
3 3
4 4 @author: roj-idl71 Karim Kuyeng
5 5 '''
6 6
7 7 import os
8 8 import sys
9 9 import glob
10 10 import fnmatch
11 11 import datetime
12 12 import time
13 13 import re
14 14 import h5py
15 15 import numpy
16 16
17 17 try:
18 18 from gevent import sleep
19 19 except:
20 20 from time import sleep
21 21
22 22 from schainpy.model.data.jroheaderIO import RadarControllerHeader, SystemHeader
23 23 from schainpy.model.data.jrodata import Voltage
24 24 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecorator
25 25 from numpy import imag
26 26
27 27
28 28 class AMISRReader(ProcessingUnit):
29 29 '''
30 30 classdocs
31 31 '''
32 32
33 33 def __init__(self):
34 34 '''
35 35 Constructor
36 36 '''
37 37
38 38 ProcessingUnit.__init__(self)
39 39
40 40 self.set = None
41 41 self.subset = None
42 42 self.extension_file = '.h5'
43 43 self.dtc_str = 'dtc'
44 44 self.dtc_id = 0
45 45 self.status = True
46 46 self.isConfig = False
47 47 self.dirnameList = []
48 48 self.filenameList = []
49 49 self.fileIndex = None
50 50 self.flagNoMoreFiles = False
51 51 self.flagIsNewFile = 0
52 52 self.filename = ''
53 53 self.amisrFilePointer = None
54 54 self.realBeamCode = []
55 55
56 56 self.dataShape = None
57 57
58 58
59 59
60 60 self.profileIndex = 0
61 61
62 62
63 63 self.beamCodeByFrame = None
64 64 self.radacTimeByFrame = None
65 65
66 66 self.dataset = None
67 67
68 68
69 69
70 70
71 71 self.__firstFile = True
72 72
73 73 self.buffer = None
74 74
75 75
76 76 self.timezone = 'ut'
77 77
78 78 self.__waitForNewFile = 20
79 79 self.__filename_online = None
80 80 #Is really necessary create the output object in the initializer
81 81 self.dataOut = Voltage()
82 82 self.dataOut.error=False
83 83
84 84
85 85 def setup(self,path=None,
86 86 startDate=None,
87 87 endDate=None,
88 88 startTime=None,
89 89 endTime=None,
90 90 walk=True,
91 91 timezone='ut',
92 92 all=0,
93 93 code = None,
94 94 nCode = 0,
95 95 nBaud = 0,
96 96 online=False):
97 97
98 98
99 99
100 100 self.timezone = timezone
101 101 self.all = all
102 102 self.online = online
103 103
104 104 self.code = code
105 105 self.nCode = int(nCode)
106 106 self.nBaud = int(nBaud)
107 107
108 108
109 109
110 110 #self.findFiles()
111 111 if not(online):
112 112 #Busqueda de archivos offline
113 113 self.searchFilesOffLine(path, startDate, endDate, startTime, endTime, walk)
114 114 else:
115 115 self.searchFilesOnLine(path, startDate, endDate, startTime,endTime,walk)
116 116
117 117 if not(self.filenameList):
118 118 print("There is no files into the folder: %s"%(path))
119 sys.exit(-1)
119 sys.exit()
120 120
121 121 self.fileIndex = 0
122 122
123 123 self.readNextFile(online)
124 124
125 125 '''
126 126 Add code
127 127 '''
128 128 self.isConfig = True
129 129 # print("Setup Done")
130 130 pass
131 131
132 132
133 133 def readAMISRHeader(self,fp):
134 134
135 135 if self.isConfig and (not self.flagNoMoreFiles):
136 136 newShape = fp.get('Raw11/Data/Samples/Data').shape[1:]
137 137 if self.dataShape != newShape and newShape != None:
138 138 print("\nNEW FILE HAS A DIFFERENT SHAPE")
139 139 print(self.dataShape,newShape,"\n")
140 140 return 0
141 141 else:
142 142 self.dataShape = fp.get('Raw11/Data/Samples/Data').shape[1:]
143 143
144 144
145 145 header = 'Raw11/Data/RadacHeader'
146 146 self.beamCodeByPulse = fp.get(header+'/BeamCode') # LIST OF BEAMS PER PROFILE, TO BE USED ON REARRANGE
147 147 if (self.startDate> datetime.date(2021, 7, 15)): #Se cambió la forma de extracción de Apuntes el 17
148 148 self.beamcodeFile = fp['Setup/Beamcodefile'][()].decode()
149 149 self.trueBeams = self.beamcodeFile.split("\n")
150 150 self.trueBeams.pop()#remove last
151 151 [self.realBeamCode.append(x) for x in self.trueBeams if x not in self.realBeamCode]
152 152 self.beamCode = [int(x, 16) for x in self.realBeamCode]
153 153 else:
154 154 _beamCode= fp.get('Raw11/Data/Beamcodes') #se usa la manera previa al cambio de apuntes
155 155 self.beamCode = _beamCode[0,:]
156 156
157 157
158 158 #self.code = fp.get(header+'/Code') # NOT USE FOR THIS
159 159 self.frameCount = fp.get(header+'/FrameCount')# NOT USE FOR THIS
160 160 self.modeGroup = fp.get(header+'/ModeGroup')# NOT USE FOR THIS
161 161 self.nsamplesPulse = fp.get(header+'/NSamplesPulse')# TO GET NSA OR USING DATA FOR THAT
162 162 self.pulseCount = fp.get(header+'/PulseCount')# NOT USE FOR THIS
163 163 self.radacTime = fp.get(header+'/RadacTime')# 1st TIME ON FILE ANDE CALCULATE THE REST WITH IPP*nindexprofile
164 164 self.timeCount = fp.get(header+'/TimeCount')# NOT USE FOR THIS
165 165 self.timeStatus = fp.get(header+'/TimeStatus')# NOT USE FOR THIS
166 166 self.rangeFromFile = fp.get('Raw11/Data/Samples/Range')
167 167 self.frequency = fp.get('Rx/Frequency')
168 168 txAus = fp.get('Raw11/Data/Pulsewidth')
169 169
170 170
171 171 self.nblocks = self.pulseCount.shape[0] #nblocks
172 172
173 173 self.nprofiles = self.pulseCount.shape[1] #nprofile
174 174 self.nsa = self.nsamplesPulse[0,0] #ngates
175 175 self.nchannels = len(self.beamCode)
176 176 self.ippSeconds = (self.radacTime[0][1] -self.radacTime[0][0]) #Ipp in seconds
177 177 #self.__waitForNewFile = self.nblocks # wait depending on the number of blocks since each block is 1 sec
178 178 self.__waitForNewFile = self.nblocks * self.nprofiles * self.ippSeconds # wait until new file is created
179 179
180 180 #filling radar controller header parameters
181 181 self.__ippKm = self.ippSeconds *.15*1e6 # in km
182 182 self.__txA = (txAus.value)*.15 #(ipp[us]*.15km/1us) in km
183 183 self.__txB = 0
184 184 nWindows=1
185 185 self.__nSamples = self.nsa
186 186 self.__firstHeight = self.rangeFromFile[0][0]/1000 #in km
187 187 self.__deltaHeight = (self.rangeFromFile[0][1] - self.rangeFromFile[0][0])/1000
188 188
189 189 #for now until understand why the code saved is different (code included even though code not in tuf file)
190 190 #self.__codeType = 0
191 191 # self.__nCode = None
192 192 # self.__nBaud = None
193 193 self.__code = self.code
194 194 self.__codeType = 0
195 195 if self.code != None:
196 196 self.__codeType = 1
197 197 self.__nCode = self.nCode
198 198 self.__nBaud = self.nBaud
199 199 #self.__code = 0
200 200
201 201 #filling system header parameters
202 202 self.__nSamples = self.nsa
203 203 self.newProfiles = self.nprofiles/self.nchannels
204 204 self.__channelList = list(range(self.nchannels))
205 205
206 206 self.__frequency = self.frequency[0][0]
207 207
208 208
209 209 return 1
210 210
211 211
212 212 def createBuffers(self):
213 213
214 214 pass
215 215
216 216 def __setParameters(self,path='', startDate='',endDate='',startTime='', endTime='', walk=''):
217 217 self.path = path
218 218 self.startDate = startDate
219 219 self.endDate = endDate
220 220 self.startTime = startTime
221 221 self.endTime = endTime
222 222 self.walk = walk
223 223
224 224 def __checkPath(self):
225 225 if os.path.exists(self.path):
226 226 self.status = 1
227 227 else:
228 228 self.status = 0
229 229 print('Path:%s does not exists'%self.path)
230 230
231 231 return
232 232
233 233
234 234 def __selDates(self, amisr_dirname_format):
235 235 try:
236 236 year = int(amisr_dirname_format[0:4])
237 237 month = int(amisr_dirname_format[4:6])
238 238 dom = int(amisr_dirname_format[6:8])
239 239 thisDate = datetime.date(year,month,dom)
240 240
241 241 if (thisDate>=self.startDate and thisDate <= self.endDate):
242 242 return amisr_dirname_format
243 243 except:
244 244 return None
245 245
246 246
247 247 def __findDataForDates(self,online=False):
248 248
249 249 if not(self.status):
250 250 return None
251 251
252 252 pat = '\d+.\d+'
253 253 dirnameList = [re.search(pat,x) for x in os.listdir(self.path)]
254 254 dirnameList = [x for x in dirnameList if x!=None]
255 255 dirnameList = [x.string for x in dirnameList]
256 256 if not(online):
257 257 dirnameList = [self.__selDates(x) for x in dirnameList]
258 258 dirnameList = [x for x in dirnameList if x!=None]
259 259 if len(dirnameList)>0:
260 260 self.status = 1
261 261 self.dirnameList = dirnameList
262 262 self.dirnameList.sort()
263 263 else:
264 264 self.status = 0
265 265 return None
266 266
267 267 def __getTimeFromData(self):
268 268 startDateTime_Reader = datetime.datetime.combine(self.startDate,self.startTime)
269 269 endDateTime_Reader = datetime.datetime.combine(self.endDate,self.endTime)
270 270
271 271 print('Filtering Files from %s to %s'%(startDateTime_Reader, endDateTime_Reader))
272 272 print('........................................')
273 273 filter_filenameList = []
274 274 self.filenameList.sort()
275 275 #for i in range(len(self.filenameList)-1):
276 276 for i in range(len(self.filenameList)):
277 277 filename = self.filenameList[i]
278 278 fp = h5py.File(filename,'r')
279 279 time_str = fp.get('Time/RadacTimeString')
280 280
281 281 startDateTimeStr_File = time_str[0][0].decode('UTF-8').split('.')[0]
282 282 #startDateTimeStr_File = "2019-12-16 09:21:11"
283 283 junk = time.strptime(startDateTimeStr_File, '%Y-%m-%d %H:%M:%S')
284 284 startDateTime_File = datetime.datetime(junk.tm_year,junk.tm_mon,junk.tm_mday,junk.tm_hour, junk.tm_min, junk.tm_sec)
285 285
286 286 #endDateTimeStr_File = "2019-12-16 11:10:11"
287 287 endDateTimeStr_File = time_str[-1][-1].decode('UTF-8').split('.')[0]
288 288 junk = time.strptime(endDateTimeStr_File, '%Y-%m-%d %H:%M:%S')
289 289 endDateTime_File = datetime.datetime(junk.tm_year,junk.tm_mon,junk.tm_mday,junk.tm_hour, junk.tm_min, junk.tm_sec)
290 290
291 291 fp.close()
292 292
293 293 #print("check time", startDateTime_File)
294 294 if self.timezone == 'lt':
295 295 startDateTime_File = startDateTime_File - datetime.timedelta(minutes = 300)
296 296 endDateTime_File = endDateTime_File - datetime.timedelta(minutes = 300)
297 if (endDateTime_File>=startDateTime_Reader and endDateTime_File<endDateTime_Reader):
298 #self.filenameList.remove(filename)
297 if (endDateTime_File>=startDateTime_Reader and endDateTime_File<=endDateTime_Reader):
299 298 filter_filenameList.append(filename)
300 299
301 if (endDateTime_File>=endDateTime_Reader):
300 if (endDateTime_File>endDateTime_Reader):
302 301 break
303 302
304 303
305 304 filter_filenameList.sort()
306 305 self.filenameList = filter_filenameList
307 306 return 1
308 307
309 308 def __filterByGlob1(self, dirName):
310 309 filter_files = glob.glob1(dirName, '*.*%s'%self.extension_file)
311 310 filter_files.sort()
312 311 filterDict = {}
313 312 filterDict.setdefault(dirName)
314 313 filterDict[dirName] = filter_files
315 314 return filterDict
316 315
317 316 def __getFilenameList(self, fileListInKeys, dirList):
318 317 for value in fileListInKeys:
319 318 dirName = list(value.keys())[0]
320 319 for file in value[dirName]:
321 320 filename = os.path.join(dirName, file)
322 321 self.filenameList.append(filename)
323 322
324 323
325 324 def __selectDataForTimes(self, online=False):
326 325 #aun no esta implementado el filtro for tiempo
327 326 if not(self.status):
328 327 return None
329 328
330 329 dirList = [os.path.join(self.path,x) for x in self.dirnameList]
331 330
332 331 fileListInKeys = [self.__filterByGlob1(x) for x in dirList]
333 332
334 333 self.__getFilenameList(fileListInKeys, dirList)
335 334 if not(online):
336 335 #filtro por tiempo
337 336 if not(self.all):
338 337 self.__getTimeFromData()
339 338
340 339 if len(self.filenameList)>0:
341 340 self.status = 1
342 341 self.filenameList.sort()
343 342 else:
344 343 self.status = 0
345 344 return None
346 345
347 346 else:
348 347 #get the last file - 1
349 self.filenameList = [self.filenameList[-2]]
348 self.filenameList = [self.filenameList[-1]]
350 349 new_dirnameList = []
351 350 for dirname in self.dirnameList:
352 351 junk = numpy.array([dirname in x for x in self.filenameList])
353 352 junk_sum = junk.sum()
354 353 if junk_sum > 0:
355 354 new_dirnameList.append(dirname)
356 355 self.dirnameList = new_dirnameList
357 356 return 1
358 357
359 358 def searchFilesOnLine(self, path, startDate, endDate, startTime=datetime.time(0,0,0),
360 359 endTime=datetime.time(23,59,59),walk=True):
361 360
362 361 if endDate ==None:
363 362 startDate = datetime.datetime.utcnow().date()
364 363 endDate = datetime.datetime.utcnow().date()
365 364
366 365 self.__setParameters(path=path, startDate=startDate, endDate=endDate,startTime = startTime,endTime=endTime, walk=walk)
367 366
368 367 self.__checkPath()
369 368
370 369 self.__findDataForDates(online=True)
371 370
372 371 self.dirnameList = [self.dirnameList[-1]]
373 372
374 373 self.__selectDataForTimes(online=True)
375 374
376 375 return
377 376
378 377
379 378 def searchFilesOffLine(self,
380 379 path,
381 380 startDate,
382 381 endDate,
383 382 startTime=datetime.time(0,0,0),
384 383 endTime=datetime.time(23,59,59),
385 384 walk=True):
386 385
387 386 self.__setParameters(path, startDate, endDate, startTime, endTime, walk)
388 387
389 388 self.__checkPath()
390 389
391 390 self.__findDataForDates()
392 391
393 392 self.__selectDataForTimes()
394 393
395 394 for i in range(len(self.filenameList)):
396 395 print("%s" %(self.filenameList[i]))
397 396
398 397 return
399 398
400 399 def __setNextFileOffline(self):
401 400
402 401 try:
403 402 self.filename = self.filenameList[self.fileIndex]
404 403 self.amisrFilePointer = h5py.File(self.filename,'r')
405 404 self.fileIndex += 1
406 405 except:
407 406 self.flagNoMoreFiles = 1
408 407 print("No more Files")
409 408 return 0
410 409
411 410 self.flagIsNewFile = 1
412 411 print("Setting the file: %s"%self.filename)
413 412
414 413 return 1
415 414
416 415
417 416 def __setNextFileOnline(self):
418 417 filename = self.filenameList[0]
419 418 if self.__filename_online != None:
420 419 self.__selectDataForTimes(online=True)
421 420 filename = self.filenameList[0]
422 421 wait = 0
423 #self.__waitForNewFile=5 ## DEBUG:
422 self.__waitForNewFile=180 ## DEBUG:
424 423 while self.__filename_online == filename:
425 424 print('waiting %d seconds to get a new file...'%(self.__waitForNewFile))
426 425 if wait == 5:
427 426 self.flagNoMoreFiles = 1
428 427 return 0
429 428 sleep(self.__waitForNewFile)
430 429 self.__selectDataForTimes(online=True)
431 430 filename = self.filenameList[0]
432 431 wait += 1
433 432
434 433 self.__filename_online = filename
435 434
436 435 self.amisrFilePointer = h5py.File(filename,'r')
437 436 self.flagIsNewFile = 1
438 437 self.filename = filename
439 438 print("Setting the file: %s"%self.filename)
440 439 return 1
441 440
442 441
443 442 def readData(self):
444 443 buffer = self.amisrFilePointer.get('Raw11/Data/Samples/Data')
445 444 re = buffer[:,:,:,0]
446 445 im = buffer[:,:,:,1]
447 446 dataset = re + im*1j
448 447
449 448 self.radacTime = self.amisrFilePointer.get('Raw11/Data/RadacHeader/RadacTime')
450 449 timeset = self.radacTime[:,0]
451 450
452 451 return dataset,timeset
453 452
454 453 def reshapeData(self):
455 454 #self.beamCodeByPulse, self.beamCode, self.nblocks, self.nprofiles, self.nsa,
456 455 channels = self.beamCodeByPulse[0,:]
457 456 nchan = self.nchannels
458 457 #self.newProfiles = self.nprofiles/nchan #must be defined on filljroheader
459 458 nblocks = self.nblocks
460 459 nsamples = self.nsa
461 460
462 461 #Dimensions : nChannels, nProfiles, nSamples
463 462 new_block = numpy.empty((nblocks, nchan, numpy.int_(self.newProfiles), nsamples), dtype="complex64")
464 463 ############################################
465 464
466 465 for thisChannel in range(nchan):
467 466 new_block[:,thisChannel,:,:] = self.dataset[:,numpy.where(channels==self.beamCode[thisChannel])[0],:]
468 467
469 468
470 469 new_block = numpy.transpose(new_block, (1,0,2,3))
471 470 new_block = numpy.reshape(new_block, (nchan,-1, nsamples))
472 471
473 472 return new_block
474 473
475 474 def updateIndexes(self):
476 475
477 476 pass
478 477
479 478 def fillJROHeader(self):
480 479
481 480 #fill radar controller header
482 481 self.dataOut.radarControllerHeaderObj = RadarControllerHeader(ipp=self.__ippKm,
483 482 txA=self.__txA,
484 483 txB=0,
485 484 nWindows=1,
486 485 nHeights=self.__nSamples,
487 486 firstHeight=self.__firstHeight,
488 487 deltaHeight=self.__deltaHeight,
489 488 codeType=self.__codeType,
490 489 nCode=self.__nCode, nBaud=self.__nBaud,
491 490 code = self.__code,
492 491 fClock=1)
493 492
494 493 #fill system header
495 494 self.dataOut.systemHeaderObj = SystemHeader(nSamples=self.__nSamples,
496 495 nProfiles=self.newProfiles,
497 496 nChannels=len(self.__channelList),
498 497 adcResolution=14,
499 498 pciDioBusWidth=32)
500 499
501 500 self.dataOut.type = "Voltage"
502 501
503 502 self.dataOut.data = None
504 503
505 504 self.dataOut.dtype = numpy.dtype([('real','<i8'),('imag','<i8')])
506 505
507 506 # self.dataOut.nChannels = 0
508 507
509 508 # self.dataOut.nHeights = 0
510 509
511 510 self.dataOut.nProfiles = self.newProfiles*self.nblocks
512 511
513 512 #self.dataOut.heightList = self.__firstHeigth + numpy.arange(self.__nSamples, dtype = numpy.float)*self.__deltaHeigth
514 513 ranges = numpy.reshape(self.rangeFromFile.value,(-1))
515 514 self.dataOut.heightList = ranges/1000.0 #km
516 515
517 516
518 517 self.dataOut.channelList = self.__channelList
519 518
520 519 self.dataOut.blocksize = self.dataOut.nChannels * self.dataOut.nHeights
521 520
522 521 # self.dataOut.channelIndexList = None
523 522
524 523 self.dataOut.flagNoData = True
525 524
526 525 #Set to TRUE if the data is discontinuous
527 526 self.dataOut.flagDiscontinuousBlock = False
528 527
529 528 self.dataOut.utctime = None
530 529
531 530 #self.dataOut.timeZone = -5 #self.__timezone/60 #timezone like jroheader, difference in minutes between UTC and localtime
532 531 if self.timezone == 'lt':
533 532 self.dataOut.timeZone = time.timezone / 60. #get the timezone in minutes
534 533 else:
535 534 self.dataOut.timeZone = 0 #by default time is UTC
536 535
537 536 self.dataOut.dstFlag = 0
538 537
539 538 self.dataOut.errorCount = 0
540 539
541 540 self.dataOut.nCohInt = 1
542 541
543 542 self.dataOut.flagDecodeData = False #asumo que la data esta decodificada
544 543
545 544 self.dataOut.flagDeflipData = False #asumo que la data esta sin flip
546 545
547 546 self.dataOut.flagShiftFFT = False
548 547
549 548 self.dataOut.ippSeconds = self.ippSeconds
550 549
551 550 #Time interval between profiles
552 551 #self.dataOut.timeInterval = self.dataOut.ippSeconds * self.dataOut.nCohInt
553 552
554 553 self.dataOut.frequency = self.__frequency
555 554 self.dataOut.realtime = self.online
556 555 pass
557 556
558 557 def readNextFile(self,online=False):
559 558
560 559 if not(online):
561 560 newFile = self.__setNextFileOffline()
562 561 else:
563 562 newFile = self.__setNextFileOnline()
564 563
565 564 if not(newFile):
566 565 self.dataOut.error = True
567 566 return 0
568 567
569 568 if not self.readAMISRHeader(self.amisrFilePointer):
570 569 self.dataOut.error = True
571 570 return 0
572 571
573 572 self.createBuffers()
574 573 self.fillJROHeader()
575 574
576 575 #self.__firstFile = False
577 576
578 577
579 578
580 579 self.dataset,self.timeset = self.readData()
581 580
582 581 if self.endDate!=None:
583 582 endDateTime_Reader = datetime.datetime.combine(self.endDate,self.endTime)
584 583 time_str = self.amisrFilePointer.get('Time/RadacTimeString')
585 584 startDateTimeStr_File = time_str[0][0].decode('UTF-8').split('.')[0]
586 585 junk = time.strptime(startDateTimeStr_File, '%Y-%m-%d %H:%M:%S')
587 586 startDateTime_File = datetime.datetime(junk.tm_year,junk.tm_mon,junk.tm_mday,junk.tm_hour, junk.tm_min, junk.tm_sec)
588 587 if self.timezone == 'lt':
589 588 startDateTime_File = startDateTime_File - datetime.timedelta(minutes = 300)
590 589 if (startDateTime_File>endDateTime_Reader):
591 590 return 0
592 591
593 592 self.jrodataset = self.reshapeData()
594 593 #----self.updateIndexes()
595 594 self.profileIndex = 0
596 595
597 596 return 1
598 597
599 598
600 599 def __hasNotDataInBuffer(self):
601 600 if self.profileIndex >= (self.newProfiles*self.nblocks):
602 601 return 1
603 602 return 0
604 603
605 604
606 605 def getData(self):
607 606
608 607 if self.flagNoMoreFiles:
609 608 self.dataOut.flagNoData = True
610 609 return 0
611 610
612 611 if self.__hasNotDataInBuffer():
613 612 if not (self.readNextFile(self.online)):
614 613 return 0
615 614
616 615
617 616 if self.dataset is None: # setear esta condicion cuando no hayan datos por leer
618 617 self.dataOut.flagNoData = True
619 618 return 0
620 619
621 620 #self.dataOut.data = numpy.reshape(self.jrodataset[self.profileIndex,:],(1,-1))
622 621
623 622 self.dataOut.data = self.jrodataset[:,self.profileIndex,:]
624 623
625 624 #print("R_t",self.timeset)
626 625
627 626 #self.dataOut.utctime = self.jrotimeset[self.profileIndex]
628 627 #verificar basic header de jro data y ver si es compatible con este valor
629 628 #self.dataOut.utctime = self.timeset + (self.profileIndex * self.ippSeconds * self.nchannels)
630 629 indexprof = numpy.mod(self.profileIndex, self.newProfiles)
631 630 indexblock = self.profileIndex/self.newProfiles
632 631 #print (indexblock, indexprof)
633 632 diffUTC = 1.8e4 #UTC diference from peru in seconds --Joab
634 633 diffUTC = 0
635 634 t_comp = (indexprof * self.ippSeconds * self.nchannels) + diffUTC #
636 635
637 636 #print("utc :",indexblock," __ ",t_comp)
638 637 #print(numpy.shape(self.timeset))
639 638 self.dataOut.utctime = self.timeset[numpy.int_(indexblock)] + t_comp
640 639 #self.dataOut.utctime = self.timeset[self.profileIndex] + t_comp
641 640 #print(self.dataOut.utctime)
642 641 self.dataOut.profileIndex = self.profileIndex
643 642 self.dataOut.flagNoData = False
644 643 # if indexprof == 0:
645 644 # print self.dataOut.utctime
646 645
647 646 self.profileIndex += 1
648 647
649 648 return self.dataOut.data
650 649
651 650
652 651 def run(self, **kwargs):
653 652 '''
654 653 This method will be called many times so here you should put all your code
655 654 '''
656 655 #print("running kamisr")
657 656 if not self.isConfig:
658 657 self.setup(**kwargs)
659 658 self.isConfig = True
660 659
661 660 self.getData()
@@ -1,25 +1,24
1 1 #!/bin/bash
2 2 #source ~/virtuals/virtual_schain3x/bin/activate
3 3 echo "Amisr EEJ Online simulation"
4 4
5 PATH_IN=/home/soporte/dataAMISR/20191216.001/
6 PATH_OUT=/home/soporte/dataAMISR_test/20191216.001/
5 PATH_IN=/media/soporte/DATA/dataAMISR/20210717.001/
6 PATH_OUT=/home/soporte/Data/OutTest/ONLINE/20210717.001/
7 7 count=0
8 8 for f in $PATH_IN*
9 9 do
10 10 if [ ${f: -3} == ".h5" ]
11 11 then
12 echo "coping $f"
12 echo "copying $f"
13 13 cp ${f} $PATH_OUT
14 sleep 5m #it takes about 5 minutes to generate new data in AMISR radar
14 echo "waiting new file..."
15 sleep 1m #it takes about 5 minutes to generate new data in AMISR radar
15 16 fi
16 17 ((count=count+1))
17 18
18 if [ $count -eq 21 ] #only transfer 20 files
19 if [ $count -eq 10 ] #only transfer 20 files
19 20 then
20 21 echo " finish simulation"
21 22 break
22 23 fi
23 24 done
24
25
@@ -1,25 +1,24
1 1 #!/bin/bash
2 2
3 3 echo "Amisr ESF Online simulation"
4 4
5 PATH_IN=/home/soporte/dataAMISR/20191217.003/
6 PATH_OUT=/home/soporte/dataAMISR_test/20191217.003/
5 PATH_IN=/media/soporte/DATA/dataAMISR/20210716.003/
6 PATH_OUT=/home/soporte/Data/OutTest/ONLINE/20210716.003/
7 7 count=0
8 8 for f in $PATH_IN*
9 9 do
10 10 if [ ${f: -3} == ".h5" ]
11 11 then
12 echo "coping $f"
12 echo "copying $f"
13 13 cp ${f} $PATH_OUT
14 sleep 5m #it takes about 5 minutes to generate new data in AMISR radar
14 echo "waiting new file..."
15 sleep 3m #it takes about 5 minutes to generate new data in AMISR radar
15 16 fi
16 17 ((count=count+1))
17 18
18 if [ $count -eq 21 ] #only transfer 20 files
19 if [ $count -eq 10 ] #only transfer 20 files
19 20 then
20 21 echo " finish simulation"
21 22 break
22 23 fi
23 24 done
24
25
@@ -1,204 +1,202
1 1
2 2 import os, sys
3 3 import time
4 4 import datetime
5 5
6 6 path = os.path.dirname(os.getcwd())
7 7 path = os.path.dirname(path)
8 8 sys.path.insert(0, path)
9 9
10 10 from schainpy.controller import Project
11 11
12 12 def main():
13 13
14 14
15 15 desc = "AMISR EEJ Experiment"
16 16 filename = "amisr_reader.xml"
17 17 xmin = '07'
18 18 xmax = '18'
19 19 xrange = int(xmax)-int(xmin)
20 ymin = '0'
21 ymax = '300'
20
22 21 dbmin = '45' #'60'#'55' #'40' #noise esf eej
23 22 dbmax = '65' #'70' #'55'
24 23 showSPC = '0' #view plot Spectra
25 24 showRTI = '0' #view plot RTI
26 25 showNOISE = '0' #view plot NOISE
27 26 localtime='1' #para ajustar el horario en las gráficas '0' para dejar en utc
28 27 code = '1,-1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,1,-1,1'
29 28 nCode = '1'
30 29 nBaud = '28'
31 30 nosamp = '1' # oversample for EEJ
32 31 today = time.strftime("%Y/%m/%d")
33 32 startDate=today
34 33 endDate=today
35 #startDate='2021/07/11'
36 #endDate='2021/07/11'
34 #startDate='2021/07/17'
35 #endDate='2021/07/17'
37 36 #inPath= '/home/soporte/dataAMISR_test/'
38 37 inPath= '/home/soporte/dataAMISR/'
39 inPath= '/media/soporte/UARS_4T_D02/AMISR_DATA/2021/'
38 #inPath= '/media/soporte/UARS_4T_D02/AMISR_DATA/2021/'
40 39 #inPath = '/home/soporte/'
41 40 outPath = '/home/soporte/Data/EEJ'
42 41
43 42 ##.......................................................................................
44 43 ##.......................................................................................
45 44
46 45 #l = startDate.split('/') #adding day of the year to outPath
47 46 l = startDate.split('/')
48 47 datelist = datetime.date(int(l[0]),int(l[1]),int(l[2]))
49 48 DOY = datelist.timetuple().tm_yday
50 49 outPath= outPath+"/EEJ"+l[0]+str(DOY)
51 50 if os.path.exists(outPath):
52 51 print("outPath", outPath)
53 52 else :
54 53 os.mkdir(outPath)
55 54 print("Creating...", outPath)
56 55
57 56 ##.......................................................................................
58 57 ##.......................................................................................
59 58 controllerObj = Project()
60 59 controllerObj.setup(id = '11', name='eej_proc', description=desc)
61 60 ##.......................................................................................
62 61 ##.......................................................................................
63 62 readUnitConfObj = controllerObj.addReadUnit(datatype='AMISRReader',
64 63 path=inPath,
65 64 startDate=startDate,#startDate, #'2014/10/07',
66 65 endDate=endDate, #endDate '2014/10/07',
67 startTime='07:00:00',#'07:00:00',
68 endTime='18:00:00',#'15:00:00',
66 startTime='07:00:30',#'07:00:00',
67 endTime='18:00:10',#'15:00:00',
69 68 walk=1,
70 69 code = code,
71 70 nCode = nCode,
72 71 nBaud = nBaud,
73 72 timezone='lt',
74 73 online=0)
75 74
76 75
77 76 # #AMISR Processing Unit
78 77 # ##.......................................................................................
79 78 # ##.......................................................................................
80 79 procUnitConfObj0 = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
81 80 opObj10 = procUnitConfObj0.addOperation(name='setAttribute')
82 81 opObj10.addParameter(name='frequency', value='445.09e6')
83 82 # opObj10 = procUnitConfObj0.addOperation(name='setRadarFrequency')
84 83 # opObj10.addParameter(name='frequency', value='445e6', format='float')
85 84
86 85
87 86 opObj01 = procUnitConfObj0.addOperation(name='Decoder', optype='other')
88 87 opObj01.addParameter(name='code', value=code, format='floatlist')
89 88 opObj01.addParameter(name='nCode', value=nCode, format='int')
90 89 opObj01.addParameter(name='nBaud', value=nBaud, format='int')
91 90 opObj01.addParameter(name='osamp', value=nosamp, format='int')
92 91
93 92
94 93 # opObj02 = procUnitConfObj0.addOperation(name='CohInt', optype='other')
95 94 # opObj02.addParameter(name='n', value='2', format='int')
96 95
97 96 #
98 97 #
99 98 # ##.......................................................................................
100 99 # ##.......................................................................................
101 100
102 101 procUnitConfObj1 = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObj0.getId())
103 102 procUnitConfObj1.addParameter(name='nFFTPoints', value='16', format='int')
104 103
105 104
106 105 opObj11 = procUnitConfObj1.addOperation(name='IncohInt', optype='other')
107 106 opObj11.addParameter(name='n', value='150', format='int') #300?
108 107
109 108 ## Remove DC signal
110 opObj11 = procUnitConfObj1.addOperation(name='removeDC')
109 ##opObj11 = procUnitConfObj1.addOperation(name='removeDC')
111 110 ##.......................................................................................
112 111 ##.......................................................................................
113 112
114 113 # opObj13 = procUnitConfObj1.addOperation(name='getNoise' , optype ='self')
115 114 # opObj13.addParameter(name='minHei', value='100', format='float')
116 115 # opObj13.addParameter(name='maxHei', value='280', format='float')
117 116
118 117
119 118 #
120 119 opObj12 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external')
121 120 opObj12.addParameter(name='id', value='21', format='int')
122 121 opObj12.addParameter(name= 'xaxis', value='velocity')
123 opObj12.addParameter(name='ymax', value=ymax, format='int')
124 122 opObj12.addParameter(name='showprofile', value='1', format='int')
125 123 opObj12.addParameter(name='wintitle', value='AMISR Beam 0', format='str')
126 124 opObj12.addParameter(name='zmin', value=dbmin, format='int')
127 125 opObj12.addParameter(name='zmax', value=dbmax, format='int')
128 126 opObj12.addParameter(name='save', value=outPath+'/plots', format='str')
129 127 opObj12.addParameter(name='colormap', value='jet', format='str')
130 128 opObj12.addParameter(name='localtime', value=localtime,format='int')
131 129 opObj12.addParameter(name='show', value = showSPC, format='int')
132 130
133 131
134 132 ##Generate *.pdata from AMISR data
135 133 ##.......................................................................................
136 134 ##.......................................................................................
137 135 opObj13 = procUnitConfObj1.addOperation(name='SpectraWriter', optype='external')
138 136 opObj13.addParameter(name='path', value=outPath)
139 137 opObj13.addParameter(name='blocksPerFile', value='10', format='int')
140 138
141 139
142 140 opObj14 = procUnitConfObj1.addOperation(name='NoisePlot', optype='external')
143 141 opObj14.addParameter(name='id', value='3', format='int')
144 142 opObj14.addParameter(name='wintitle', value='title0', format='str')
145 143 opObj14.addParameter(name='showprofile', value='0', format='int')
146 144 opObj14.addParameter(name='tmin', value=xmin, format='int')
147 145 opObj14.addParameter(name='xrange', value=xrange, format='int')
148 146 opObj14.addParameter(name='ymin', value=dbmin, format='int')
149 147 opObj14.addParameter(name='ymax', value=dbmax, format='int')
150 148 opObj14.addParameter(name='save', value=outPath+'/plots', format='str')
151 149 opObj14.addParameter(name='localtime', value=localtime,format='int')
152 150 opObj14.addParameter(name='show', value = showNOISE, format='int')
153 151
154 152 # #
155 153 opObj15 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external')
156 154 opObj15.addParameter(name='id', value='2', format='int')
157 155 opObj15.addParameter(name='localtime', value=localtime,format='int')
158 156 opObj15.addParameter(name='wintitle', value='RTI', format='str')
159 157 opObj15.addParameter(name='tmin', value=xmin, format='int')
160 158 opObj15.addParameter(name='xrange', value=xrange, format='int')
161 159 opObj15.addParameter(name='ymin', value=ymin, format='int')
162 160 opObj15.addParameter(name='zmin', value=dbmin, format='int')
163 161 opObj15.addParameter(name='zmax', value=dbmax, format='int')
164 162 opObj15.addParameter(name='showprofile', value='0', format='int')
165 163 opObj15.addParameter(name='save', value=outPath+'/plots', format='str')
166 164 opObj15.addParameter(name='colormap', value='jet', format='str')
167 165 opObj15.addParameter(name='show', value = showRTI, format='int')
168 166
169 167
170 168
171 169 ##.......................................................................................
172 170 ##.......................................................................................
173 171 #
174 172 # procUnitConfObj2 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObj1.getId())
175 173 # opObj16 = procUnitConfObj2.addOperation(name='SpectralMoments', optype='other')
176 174
177 175
178 176 #Using HDFWriter::::
179 177 #.......................................................................................
180 178 #.......................................................................................
181 179 # opObj17 = procUnitConfObj2.addOperation(name='HDFWriter', optype='external')
182 180 # opObj17.addParameter(name='path', value=outPath)
183 181 # opObj17.addParameter(name='blocksPerFile', value='10', format='int')
184 182 # opObj17.addParameter(name='metadataList',value='type,inputUnit,heightList',format='list')
185 183 # opObj17.addParameter(name='dataList',value='moments,data_SNR,utctime',format='list')
186 184
187 185
188 186
189 187 ##.......................................................................................
190 188 ##.......................................................................................
191 189 #print("Escribiendo el archivo XML",controllerObj.writeXml(outPath +'/'+filename))
192 190
193 191 controllerObj.start()
194 192
195 193 #print("Leyendo el archivo XML",controllerObj.readXml(outPath +'/'+filename))
196 194
197 195 ##.......................................................................................
198 196 ##.......................................................................................
199 197
200 198 if __name__ == '__main__':
201 199 import time
202 200 start_time = time.time()
203 201 main()
204 202 print("--- %s seconds ---" % (time.time() - start_time))
@@ -1,161 +1,169
1 1 #!/usr/bin/env python
2 2 import os, sys
3 3 import time
4 4 import datetime
5 5
6 6 path = os.path.dirname(os.getcwd())
7 7 path = os.path.dirname(path)
8 8 sys.path.insert(0, path)
9 9
10 10 from schainpy.controller import Project
11 11
12 12 def main():
13 13
14 14
15 15 desc = "AMISR EEJ Experiment"
16 16 filename = "amisr_reader.xml"
17 17 xmin = '07'
18 18 xmax = '18' #
19 19 xrange = int(xmax)-int(xmin)
20 20
21 21 dbmin = '45' #'60'#'55' #'40' #noise esf eej
22 22 dbmax = '65' #'70' #'55'
23 showSPC = '1' #view plot Spectra
24 showRTI = '1' #view plot RTI
25 showNOISE = '1' #view plot NOISE
23 showSPC = '0' #view plot Spectra
24 showRTI = '0' #view plot RTI
25 showNOISE = '0' #view plot NOISE
26 26 localtime='1' #para ajustar el horario en las gráficas '0' para dejar en utc
27 27 code = '1,-1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,1,-1,1'
28 28 nCode = '1'
29 29 nBaud = '28'
30 30 nosamp = '1' # oversample for EEJ
31 31 str0 = datetime.date.today()
32 32 today = str0.strftime("%Y/%m/%d")
33 33 startDate=today
34 34 endDate=today
35 #startDate='2019/12/16'
36 #endDate='2019/12/16'
37 #inPath= '/home/soporte/dataAMISR_testONLINE/'
35 #startDate='2021/07/17'
36 #endDate='2021/07/17'
37 #inPath= '/home/soporte/Data/OutTest/ONLINE/'
38 38 #inPath= '/home/soporte/dataAMISR/'
39 39 inPath = '/mnt/data_amisr'
40 40 outPath = '/home/soporte/Data/EEJ'
41 41
42 42 ##.......................................................................................
43 43 ##.......................................................................................
44 44
45 45 l = startDate.split('/') #adding day of the year to outPath
46 46 datelist = datetime.date(int(l[0]),int(l[1]),int(l[2]))
47 47 DOY = datelist.timetuple().tm_yday
48 48 outPath= outPath+"/EEJ"+l[0]+str(DOY)
49 49 if os.path.exists(outPath):
50 50 print("outPath", outPath)
51 51 else :
52 52 os.mkdir(outPath)
53 53 print("Creating...", outPath)
54 54 ##.......................................................................................
55 55 ##.......................................................................................
56 56 controllerObj = Project()
57 57 controllerObj.setup(id = '10', name='eej_proc', description=desc)
58 58 ##.......................................................................................
59 59 ##.......................................................................................
60 60 readUnitConfObj = controllerObj.addReadUnit(datatype='AMISRReader',
61 61 path=inPath,
62 62 startDate=startDate,
63 63 endDate=endDate,
64 startTime='07:01:30',#'07:00:00',
64 startTime='07:01:00',#'07:00:00',
65 65 endTime='17:55:00',#'15:00:00',
66 66 walk=0,
67 67 code = code,
68 68 nCode = nCode,
69 69 nBaud = nBaud,
70 70 timezone='lt',
71 71 online=1)
72 72
73 73 #AMISR Processing Unit
74 74 ##.......................................................................................
75 75 ##.......................................................................................
76 76 procUnitConfObj0 = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
77 77 opObj10 = procUnitConfObj0.addOperation(name='setAttribute')
78 78 opObj10.addParameter(name='frequency', value='445.0e6')
79 79
80 80
81 81 opObj01 = procUnitConfObj0.addOperation(name='Decoder', optype='other')
82 82 opObj01.addParameter(name='code', value=code, format='floatlist')
83 83 opObj01.addParameter(name='nCode', value=nCode, format='int')
84 84 opObj01.addParameter(name='nBaud', value=nBaud, format='int')
85 85 opObj01.addParameter(name='osamp', value=nosamp, format='int')
86 86
87 87
88 88
89 89
90 90
91 91 ##.......................................................................................
92 92 ##.......................................................................................
93 93
94 94 procUnitConfObj1 = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObj0.getId())
95 95 procUnitConfObj1.addParameter(name='nFFTPoints', value='16', format='int')
96 96
97 97
98 98 opObj11 = procUnitConfObj1.addOperation(name='IncohInt', optype='other')
99 99 opObj11.addParameter(name='n', value='150', format='int') #300 normal value
100 100
101 101 ##.......................................................................................
102 102 ##.......................................................................................
103 103
104 104
105 105 #
106 106 opObj12 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external')
107 107 opObj12.addParameter(name='id', value='21', format='int')
108 108 opObj12.addParameter(name= 'xaxis', value='velocity')
109 opObj12.addParameter(name='ymax', value=ymax, format='int')
110 109 opObj12.addParameter(name='showprofile', value='1', format='int')
111 110 opObj12.addParameter(name='wintitle', value='AMISR Beam 0', format='str')
112 111 opObj12.addParameter(name='zmin', value=dbmin, format='int')
113 112 opObj12.addParameter(name='zmax', value=dbmax, format='int')
114 113 opObj12.addParameter(name='save', value=outPath+'/plots', format='str')
115 114 opObj12.addParameter(name='colormap', value='jet', format='str')
116 115 opObj12.addParameter(name='localtime', value=localtime,format='int')
117 116 opObj12.addParameter(name='show', value = showSPC, format='int')
118
117 opObj12.addParameter(name='exp_code', value='206', format='int')
118 opObj12.addParameter(name='server', value='jro-realtime.igp.gob.pe:4444')
119 opObj12.addParameter(name='sender_period', value='120')
120 opObj12.addParameter(name='tag', value='AMISR')
119 121
120 122 opObj14 = procUnitConfObj1.addOperation(name='NoisePlot', optype='external')
121 123 opObj14.addParameter(name='id', value='3', format='int')
122 124 opObj14.addParameter(name='wintitle', value='title0', format='str')
123 125 opObj14.addParameter(name='showprofile', value='0', format='int')
124 126 opObj14.addParameter(name='tmin', value=xmin, format='int')
125 127 opObj14.addParameter(name='xrange', value=xrange, format='int')
126 128 opObj14.addParameter(name='ymin', value=dbmin, format='int')
127 129 opObj14.addParameter(name='ymax', value=dbmax, format='int')
128 130 opObj14.addParameter(name='save', value=outPath+'/plots', format='str')
129 131 opObj14.addParameter(name='localtime', value=localtime,format='int')
130 132 opObj14.addParameter(name='show', value = showNOISE, format='int')
131
133 opObj14.addParameter(name='exp_code', value='206', format='int')
134 opObj14.addParameter(name='server', value='jro-realtime.igp.gob.pe:4444')
135 opObj14.addParameter(name='sender_period', value='120')
136 opObj14.addParameter(name='tag', value='AMISR')
132 137
133 138 opObj15 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external')
134 139 opObj15.addParameter(name='id', value='2', format='int')
135 140 opObj15.addParameter(name='localtime', value=localtime,format='int')
136 141 opObj15.addParameter(name='wintitle', value='RTI', format='str')
137 142 opObj15.addParameter(name='tmin', value=xmin, format='int')
138 143 opObj15.addParameter(name='xrange', value=xrange, format='int')
139 144 opObj15.addParameter(name='zmin', value=dbmin, format='int')
140 145 opObj15.addParameter(name='zmax', value=dbmax, format='int')
141 146 opObj15.addParameter(name='showprofile', value='1', format='int')
142 147 opObj15.addParameter(name='save', value=outPath+'/plots', format='str')
143 148 opObj15.addParameter(name='colormap', value='jet', format='str')
144 149 opObj15.addParameter(name='show', value = showRTI, format='int')
145
150 opObj15.addParameter(name='exp_code', value='206', format='int')
151 opObj15.addParameter(name='server', value='jro-realtime.igp.gob.pe:4444')
152 opObj15.addParameter(name='sender_period', value='120')
153 opObj15.addParameter(name='tag', value='AMISR')
146 154
147 155
148 156 ##.......................................................................................
149 157 ##.......................................................................................
150 158 #
151 159
152 160 controllerObj.start()
153 161
154 162 ##.......................................................................................
155 163 ##.......................................................................................
156 164
157 165 if __name__ == '__main__':
158 166 import time
159 167 start_time = time.time()
160 168 main()
161 169 print("--- %s seconds ---" % (time.time() - start_time))
@@ -1,232 +1,224
1 #!/usr/bin/env python
1
2 2 import os, sys
3 3 import time
4 4 import datetime
5 5
6 6 '''
7 7 ESF 10 BEAM OFFLINE
8 8 '''
9 9 path = os.path.dirname(os.getcwd())
10 10 path = os.path.dirname(path)
11 11 sys.path.insert(0, path)
12 12
13 13 from schainpy.controller import Project
14 14
15 15
16 16 def main():
17 17 desc = "AMISR ESF 10 Beam Experiment"
18 18
19 19 filename = "amisr_esf_reader.xml"
20 20
21 21
22 22
23 23 #path = os.path.join(os.environ['HOME'],'amisr')
24 24 inPath = '/mnt/data_amisr'
25 25 inPath= '/home/soporte/dataAMISR/'
26 26 inPath= '/media/soporte/DATA/dataAMISR/'
27 27
28 28 outPath = '/home/soporte/Data/ESF'
29 29 remotefolder = "/home/wmaster/graficos"
30 30 xmin = '18'
31 31 xmax = '31'
32 32 xrange = int(xmax)-int(xmin)
33 33 dbmin = '60' #'60'#'55' #'40' #noise esf eej
34 34 dbmax = '75' #'70' #'55'
35 showSPC = '1' #view plot Spectra
35 showSPC = '0' #view plot Spectra
36 36 showRTI = '0' #view plot RTI
37 showNOISE = '1' #view plot NOISE
37 showNOISE = '0' #view plot NOISE
38 38 # # code = '1,1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,-1,-1,-1'
39 39 # # code = '1,1,0,1,1,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,0,0,0'
40 40 code = '1,-1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,1,-1,1'
41 41 nCode = '1'
42 42 nBaud = '28'
43 43 nosamp = '2' # oversample
44 44 localtime='1' #para ajustar el horario en las gráficas '0' para dejar en utc
45 45
46 46 str0 = datetime.date.today()
47 47 str1 = str0 + datetime.timedelta(days=1)
48 48 str2 = str0 - datetime.timedelta(days=1)
49 49 today = str0.strftime("%Y/%m/%d")
50 50 tomorrow = str1.strftime("%Y/%m/%d")
51 51 yesterday = str2.strftime("%Y/%m/%d")
52 52
53 53 startDate=yesterday
54 54 endDate=today
55 55
56 startDate='2019/12/17'
57 endDate='2019/12/18'
56 #startDate='2021/07/16'
57 #endDate='2021/07/17'
58 58 ##.......................................................................................
59 59 ##.......................................................................................
60 60 l = startDate.split('/') #adding day of the year to outPath
61 61 datelist = datetime.date(int(l[0]),int(l[1]),int(l[2]))
62 62 DOY = datelist.timetuple().tm_yday
63 63 outPath= outPath+"/ESF"+l[0]+str(DOY)
64 64 if os.path.exists(outPath):
65 65 print("outPath", outPath)
66 66 else :
67 67 os.mkdir(outPath)
68 68 print("Creating...", outPath)
69 69 ##.......................................................................................
70 70 ##.......................................................................................
71 71
72 72 controllerObj = Project()
73 73 controllerObj.setup(id = '20', name='esf_proc', description=desc)
74 74 ##.......................................................................................
75 75 ##.......................................................................................
76 76
77 77 readUnitConfObj = controllerObj.addReadUnit(datatype='AMISRReader',
78 78 path=inPath,
79 79 startDate=startDate,#startDate,#'2016/07/12',
80 80 endDate=endDate,#endDate,#'2016/07/13',
81 startTime='23:40:30',#'07:00:00',
82 endTime='07:00:00',#'15:00:00',
81 startTime='18:00:10',#'07:00:00',
82 endTime='07:00:10',#'15:00:00',
83 83 walk=0,
84 84 code = code,
85 85 nCode = nCode,
86 86 nBaud = nBaud,
87 87 timezone='lt',
88 88 online=0)
89 89
90 90 #AMISR Processing Unit
91 91 ##.......................................................................................
92 92 ##.......................................................................................
93 93
94 94 #Voltage Processing Unit
95 95 procUnitConfObjBeam0 = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
96 96 opObj10 = procUnitConfObjBeam0.addOperation(name='setAttribute')
97 97 opObj10.addParameter(name='frequency', value='445.09e6')
98 98
99 '''
99
100 100 #Noise--> no code
101 101
102 102 opObj11 = procUnitConfObjBeam0.addOperation(name='Decoder', optype='other')
103 103 opObj11.addParameter(name='code', value=code, format='floatlist')
104 104 opObj11.addParameter(name='nCode', value=nCode, format='int')
105 105 opObj11.addParameter(name='nBaud', value=nBaud, format='int')
106 106 opObj11.addParameter(name='osamp', value=nosamp, format='int')
107 107
108 108
109 109 # opObj12 = procUnitConfObjBeam0.addOperation(name='selectHeights')
110 110 # opObj12.addParameter(name='minHei', value='50', format='float')
111 111 # opObj12.addParameter(name='maxHei', value='150', format='float')
112 112
113 113 # #Coherent Integration
114 114 # opObj11 = procUnitConfObjBeam0.addOperation(name='CohInt', optype='other')
115 115 # opObj11.addParameter(name='n', value='2', format='int')
116 116
117 117 ##.......................................................................................
118 118 ##.......................................................................................
119 119
120 120 #Spectra Unit Processing, getting spectras with nProfiles and nFFTPoints
121 121 procUnitConfObjSpectraBeam0 = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjBeam0.getId())
122 122 procUnitConfObjSpectraBeam0.addParameter(name='nFFTPoints', value=16, format='int')
123 123 #
124 124 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='IncohInt', optype='other')
125 opObj11.addParameter(name='n', value='260', format='int')
125 opObj11.addParameter(name='n', value='60', format='int')
126 126 #opObj11.addParameter(name='timeInterval', value='30', format='int')
127 127 #
128 128 #
129 129 # # # #RemoveDc
130 130 #opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='removeDC')
131 131 #
132 132 # ##Noise Estimation #so reconoce nueva version
133 # opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='getNoise', optype='self')
134 # opObj11.addParameter(name='minHei', value='100', format='int')
135 # opObj11.addParameter(name='maxHei', value='280', format='int')
136 # #opObj11.addParameter(name='minHei', value='15', format='int')
137 # #opObj11.addParameter(name='maxHei', value='20', format='int')
133 ## opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='getNoise', optype='self')
134 ## opObj11.addParameter(name='minHei', value='100', format='int')
135 ## opObj11.addParameter(name='maxHei', value='280', format='int')
136 ## #opObj11.addParameter(name='minHei', value='15', format='int')
137 ## #opObj11.addParameter(name='maxHei', value='20', format='int')
138 138
139 139 #---
140 140 # opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='selectChannels')
141 141 # opObj11.addParameter(name='channelList', value='7,8,9', format='intlist')
142 142
143 143 ##.......................................................................................
144 144 ##.......................................................................................
145 145
146 146 #SpectraPlot
147 147 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='SpectraPlot', optype='external')
148 148 opObj11.addParameter(name='id', value='1', format='int')
149 149 opObj11.addParameter(name='wintitle', value='ESF AMISR', format='str')
150 150 opObj11.addParameter(name='showprofile', value='1', format='int')
151 151 opObj11.addParameter(name='zmin', value=dbmin, format='int')
152 152 opObj11.addParameter(name='zmax', value=dbmax, format='int')
153 153 opObj11.addParameter(name='save', value=outPath+'/plots', format='str')
154 154 opObj11.addParameter(name='ftp', value='1', format='int')
155 # opObj11.addParameter(name='wr_period', value='2', format='int')
156 # opObj11.addParameter(name='exp_code', value='21', format='int')
157 # opObj11.addParameter(name='sub_exp_code', value='4', format='int')
158 # opObj11.addParameter(name='ftp_wei', value='0', format='int')
159 # opObj11.addParameter(name='plot_pos', value='0', format='int')
155
160 156 opObj11.addParameter(name='localtime', value=localtime,format='int')
161 157 opObj11.addParameter(name='show', value = showSPC, format='int')
162 158
163 159 #RTIPlot
164 160 #title0 = 'RTI AMISR Beam 0'
165 161 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='RTIPlot', optype='external')
166 162 opObj11.addParameter(name='id', value='2', format='int')
167 163 opObj11.addParameter(name='wintitle', value='ESF AMISR', format='str')
168 164 opObj11.addParameter(name='showprofile', value='0', format='int')
169 165 opObj11.addParameter(name='tmin', value=xmin, format='int')
170 166 opObj11.addParameter(name='xrange', value=xrange, format='int')
171 167 opObj11.addParameter(name='zmin', value=dbmin, format='int')
172 168 opObj11.addParameter(name='zmax', value=dbmax, format='int')
173 169 opObj11.addParameter(name='save', value=outPath+'/plots', format='str')
174 170 opObj11.addParameter(name='ftp', value='1', format='int')
175 171 opObj11.addParameter(name='wr_period', value='2', format='int')
176 # opObj11.addParameter(name='exp_code', value='21', format='int')
177 # opObj11.addParameter(name='sub_exp_code', value='4', format='int')
178 # opObj11.addParameter(name='ftp_wei', value='0', format='int')
179 # opObj11.addParameter(name='plot_pos', value='0', format='int')
180 172 opObj11.addParameter(name='localtime', value=localtime,format='int')
181 173 opObj11.addParameter(name='show', value = showRTI, format='int')
182 174
183 175
184 176 # # #
185 177 # #Noise
186 178 #title0 = 'RTI AMISR Beam 0'
187 179 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='NoisePlot', optype='external')
188 180 opObj11.addParameter(name='id', value='3', format='int')
189 181 opObj11.addParameter(name='wintitle', value='ESF AMISR', format='str')
190 182 opObj11.addParameter(name='showprofile', value='0', format='int')
191 183 opObj11.addParameter(name='tmin', value=xmin, format='int')
192 184 opObj11.addParameter(name='xrange', value=xrange, format='int')
193 185 #opObj11.addParameter(name='ymin', value=dbmin, format='int')
194 186 #opObj11.addParameter(name='ymax', value=dbmax, format='int')
195 187 opObj11.addParameter(name='save', value=outPath+'/plots', format='str')
196 188 opObj11.addParameter(name='show', value = showNOISE, format='int')
197 189 opObj11.addParameter(name='localtime', value=localtime,format='int')
198 190
199 191 #Generate *.pdata from AMISR data
200 192 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='SpectraWriter', optype='external')
201 193 opObj11.addParameter(name='path', value=outPath)
202 194 opObj11.addParameter(name='blocksPerFile', value='10', format='int')
203 '''
195
204 196 ##.......................................................................................
205 197 ##.......................................................................................
206 198
207 199 # #generate moments
208 200 # procUnitConfObj2 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObjSpectraBeam0.getId())
209 201 # opObj20 = procUnitConfObj2.addOperation(name='SpectralMoments', optype='other')
210 202 #
211 203 # opObj12 = procUnitConfObj2.addOperation(name='ParamWriter', optype='external')
212 204 # opObj12.addParameter(name='path', value=outPath)
213 205 # opObj12.addParameter(name='blocksPerFile', value='10', format='int')
214 206 # opObj12.addParameter(name='metadataList',value='type,inputUnit,heightList',format='list')
215 207 # opObj12.addParameter(name='dataList',value='moments,data_SNR,utctime',format='list')
216 208 # opObj12.addParameter(name='mode',value='1',format='int')
217 209 #
218 210 #
219 211 # ----
220 212
221 213
222 214 # print "Escribiendo el archivo XML"
223 215 # controllerObj.writeXml(outPath+"/"filename)
224 216 controllerObj.start()
225 217 # print "Leyendo el archivo XML"
226 218 # controllerObj.readXml(outPath+"/"filename)
227 219
228 220 if __name__ == '__main__':
229 221 import time
230 222 start_time = time.time()
231 223 main()
232 224 print("--- %s seconds ---" % (time.time() - start_time))
@@ -1,203 +1,220
1 #!/usr/bin/env python
1
2 2 import os, sys
3 3 import time
4 4 import datetime
5 5
6 6 '''
7 ESF 10 BEAM ONLINE
7 ESF EW 10 BEAM ONLINE
8 8 '''
9 9 path = os.path.dirname(os.getcwd())
10 10 path = os.path.dirname(path)
11 11 sys.path.insert(0, path)
12 12
13 13 from schainpy.controller import Project
14 14
15 15
16 16 def main():
17 17 desc = "AMISR ESF 10 Beam Experiment"
18 18
19 19 filename = "amisr_esf_reader.xml"
20 20
21 21
22 22
23 23 #path = os.path.join(os.environ['HOME'],'amisr')
24 inPath = '/mnt/data_amisr'
24 inPath= '/home/soporte/Data/OutTest/ONLINE/'
25 #inPath = '/mnt/data_amisr'
25 26 #path= '/home/soporte/dataAMISR/'
26 27 #inPath= '/home/soporte/dataAMISR_test/'
27 28 outPath = '/home/soporte/Data/ESF'
28 remotefolder = "/home/wmaster/graficos"
29 remotefolder = "/home/wmaster/test/graficos"
29 30 xmin = '18'
30 xmax = '07'
31 xmax = '31'
32 xrange = int(xmax)-int(xmin)
31 33 dbmin = '60' #'60'#'55' #'40' #noise esf eej
32 34 dbmax = '75' #'70' #'55'
33 showSPC = '1' #view plot Spectra
34 showRTI = '1' #view plot RTI
35 showNOISE = '1' #view plot NOISE
35 showSPC = '0' #view plot Spectra
36 showRTI = '0' #view plot RTI
37 showNOISE = '0' #view plot NOISE
36 38 # # code = '1,1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,1,1,1,-1,-1,-1'
37 39 # # code = '1,1,0,1,1,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,0,0,0'
38 40 code = '1,-1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,1,-1,1'
39 41 nCode = '1'
40 42 nBaud = '28'
41 43 nosamp = '2' # oversample
42 localtime='0' #para ajustar el horario en las gráficas '0' para dejar en utc
44 localtime='1' #para ajustar el horario en las gráficas '0' para dejar en utc
43 45
44 46 dty = datetime.date.today() #ONLINE
45 47 str1 = dty + datetime.timedelta(days=1)
46 48 str2 = dty - datetime.timedelta(days=1)
47 49 today = dty.strftime("%Y/%m/%d")
48 50 tomorrow = str1.strftime("%Y/%m/%d")
49 51 yesterday = str2.strftime("%Y/%m/%d")
50 52 startDate=today
51 53 endDate=tomorrow
52 #startDate='2019/12/17'
53 #endDate='2019/12/18'
54 #startDate='2021/07/16'
55 #endDate='2021/07/17'
54 56 ##.......................................................................................
55 57 ##.......................................................................................
56 58 l = startDate.split('/') #adding day of the year to outPath
57 59 datelist = datetime.date(int(l[0]),int(l[1]),int(l[2]))
58 60 DOY = datelist.timetuple().tm_yday
59 61 outPath= outPath+"/ESF"+l[0]+str(DOY)
60 62 if os.path.exists(outPath):
61 63 print("outPath", outPath)
62 64 else :
63 65 os.mkdir(outPath)
64 66 print("Creating...", outPath)
65 67 ##.......................................................................................
66 68 ##.......................................................................................
67 69
68 70 controllerObj = Project()
69 71 controllerObj.setup(id = '21', name='esf_proc', description=desc)
70 72 ##.......................................................................................
71 73 ##.......................................................................................
72 74
73 75 readUnitConfObj = controllerObj.addReadUnit(datatype='AMISRReader',
74 76 path=inPath,
75 77 startDate=startDate,#'2016/07/12',
76 78 endDate=endDate,#'2016/07/13',
77 startTime='19:01:30',#'07:00:00',
78 endTime='07:00:00',#'15:00:00',
79 startTime='18:01:00',#'07:00:00',
80 endTime='06:55:00',#'15:00:00',
79 81 walk=0,
80 82 code = code,
81 83 nCode = nCode,
82 84 nBaud = nBaud,
83 85 timezone='lt',
84 86 online=1)
85 87
86 88 #AMISR Processing Unit
87 89 ##.......................................................................................
88 90 ##.......................................................................................
89 91
90 92 #Voltage Processing Unit
91 93 procUnitConfObjBeam0 = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId())
92 opObj10 = procUnitConfObjBeam0.addOperation(name='setRadarFrequency')
94 opObj10 = procUnitConfObjBeam0.addOperation(name='setAttribute')
95 opObj10.addParameter(name='frequency', value='445.0e6')
96
93 97 #opObj10.addParameter(name='frequency', value='445e6', format='int') #changed on Dec 3, 15:40h
94 98
95 99
96 100 #Noise--> no code
97 101
98 102 opObj11 = procUnitConfObjBeam0.addOperation(name='Decoder', optype='other')
99 103 opObj11.addParameter(name='code', value=code, format='floatlist')
100 104 opObj11.addParameter(name='nCode', value=nCode, format='int')
101 105 opObj11.addParameter(name='nBaud', value=nBaud, format='int')
102 106 opObj11.addParameter(name='osamp', value=nosamp, format='int')
103 107
104 108
105 109 # opObj12 = procUnitConfObjBeam0.addOperation(name='selectHeights')
106 110 # opObj12.addParameter(name='minHei', value='50', format='float')
107 111 # opObj12.addParameter(name='maxHei', value='150', format='float')
108 112
109 113 # #Coherent Integration
110 114 # opObj11 = procUnitConfObjBeam0.addOperation(name='CohInt', optype='other')
111 115 # opObj11.addParameter(name='n', value='2', format='int')
112 116
113 117 ##.......................................................................................
114 118 ##.......................................................................................
115 119
116 120 #Spectra Unit Processing, getting spectras with nProfiles and nFFTPoints
117 121 procUnitConfObjSpectraBeam0 = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObjBeam0.getId())
118 122 procUnitConfObjSpectraBeam0.addParameter(name='nFFTPoints', value=16, format='int')
119 123 #
120 124 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='IncohInt', optype='other')
121 125 opObj11.addParameter(name='n', value='60', format='int')
122 126 #opObj11.addParameter(name='timeInterval', value='30', format='int')
123 127
124 128
125 129 # # #RemoveDc
126 130 #opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='removeDC')
127 131
128 132
129 133 #---
130 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='selectChannels')
131 opObj11.addParameter(name='channelList', value='0,2,4,6,8', format='intlist')
134 #opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='selectChannels')
135 #opObj11.addParameter(name='channelList', value='0,2,4,6,8', format='intlist')
132 136
133 137 ##.......................................................................................
134 138 ##.......................................................................................
135 139
136 140 #SpectraPlot
137 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='SpectraPlot', optype='external')
138 opObj11.addParameter(name='id', value='1', format='int')
139 opObj11.addParameter(name='wintitle', value='ESF AMISR', format='str')
140 opObj11.addParameter(name='showprofile', value='1', format='int')
141 opObj11.addParameter(name='zmin', value=dbmin, format='int')
142 opObj11.addParameter(name='zmax', value=dbmax, format='int')
143 opObj11.addParameter(name='save', value=outPath+'/plots', format='str')
144 # opObj11.addParameter(name='ftp', value='1', format='int')
145 # opObj11.addParameter(name='wr_period', value='2', format='int')
146 # opObj11.addParameter(name='exp_code', value='21', format='int')
147 # opObj11.addParameter(name='sub_exp_code', value='4', format='int')
148 # opObj11.addParameter(name='ftp_wei', value='0', format='int')
149 # opObj11.addParameter(name='plot_pos', value='0', format='int')
150 opObj11.addParameter(name='localtime', value=localtime,format='int')
151 opObj11.addParameter(name='show', value = showSPC, format='int')
152 opObj11.addParameter(name='colormap', value='jet', format='str')
153
141 opObj12 = procUnitConfObjSpectraBeam0.addOperation(name='SpectraPlot', optype='external')
142 opObj12.addParameter(name='id', value='1', format='int')
143 opObj12.addParameter(name='wintitle', value='ESF AMISR', format='str')
144 opObj12.addParameter(name='showprofile', value='1', format='int')
145 opObj12.addParameter(name='zmin', value=dbmin, format='int')
146 opObj12.addParameter(name='zmax', value=dbmax, format='int')
147 opObj12.addParameter(name='save', value=outPath+'/plots', format='str')
148 opObj12.addParameter(name='localtime', value=localtime,format='int')
149 opObj12.addParameter(name='show', value = showSPC, format='int')
150 opObj12.addParameter(name='colormap', value='jet', format='str')
151 opObj12.addParameter(name='exp_code', value='207', format='int')
152 opObj12.addParameter(name='server', value='jro-realtime.igp.gob.pe:4444')
153 opObj12.addParameter(name='sender_period', value='120')
154 opObj12.addParameter(name='tag', value='AMISR')
154 155
155 156 #RTIPlot
156 157 #title0 = 'RTI AMISR Beam 0'
157 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='RTIPlot', optype='external')
158 opObj11.addParameter(name='id', value='2', format='int')
159 opObj11.addParameter(name='wintitle', value='ESF AMISR', format='str')
160 opObj11.addParameter(name='showprofile', value='0', format='int')
161 opObj11.addParameter(name='tmin', value=xmin, format='int')
162 opObj11.addParameter(name='tmax', value=xmax,format='int')
163 opObj11.addParameter(name='zmin', value=dbmin, format='int')
164 opObj11.addParameter(name='zmax', value=dbmax, format='int')
165 opObj11.addParameter(name='save', value=outPath+'/plots', format='str')
166 #opObj11.addParameter(name='ftp', value='1', format='int')
167 #opObj11.addParameter(name='wr_period', value='2', format='int')
168 # opObj11.addParameter(name='exp_code', value='21', format='int')
169 # opObj11.addParameter(name='sub_exp_code', value='4', format='int')
170 # opObj11.addParameter(name='ftp_wei', value='0', format='int')
171 # opObj11.addParameter(name='plot_pos', value='0', format='int')
172 opObj11.addParameter(name='localtime', value=localtime,format='int')
173 opObj11.addParameter(name='show', value = showRTI, format='int')
174 opObj11.addParameter(name='colormap', value='jet', format='str')
158 opObj13 = procUnitConfObjSpectraBeam0.addOperation(name='RTIPlot', optype='external')
159 opObj13.addParameter(name='id', value='2', format='int')
160 opObj13.addParameter(name='wintitle', value='ESF AMISR', format='str')
161 opObj13.addParameter(name='showprofile', value='0', format='int')
162 opObj13.addParameter(name='tmin', value=xmin, format='int')
163 opObj13.addParameter(name='xrange', value=xrange,format='int')
164 opObj13.addParameter(name='zmin', value=dbmin, format='int')
165 opObj13.addParameter(name='zmax', value=dbmax, format='int')
166 opObj13.addParameter(name='save', value=outPath+'/plots', format='str')
167 opObj13.addParameter(name='localtime', value=localtime,format='int')
168 opObj13.addParameter(name='show', value = showRTI, format='int')
169 opObj13.addParameter(name='colormap', value='jet', format='str')
170 opObj13.addParameter(name='exp_code', value='207', format='int')
171 opObj13.addParameter(name='server', value='jro-realtime.igp.gob.pe:4444')
172 opObj13.addParameter(name='sender_period', value='120')
173 opObj13.addParameter(name='tag', value='AMISR')
175 174
176 175 # # #
177 176 # #Noise
178 177 #title0 = 'RTI AMISR Beam 0'
179 opObj11 = procUnitConfObjSpectraBeam0.addOperation(name='NoisePlot', optype='external')
180 opObj11.addParameter(name='id', value='3', format='int')
181 opObj11.addParameter(name='wintitle', value='ESF AMISR', format='str')
182 opObj11.addParameter(name='showprofile', value='0', format='int')
183 opObj11.addParameter(name='tmin', value=xmin, format='int')
184 opObj11.addParameter(name='tmax', value=xmax, format='int')
178 opObj14 = procUnitConfObjSpectraBeam0.addOperation(name='NoisePlot', optype='external')
179 opObj14.addParameter(name='id', value='3', format='int')
180 opObj14.addParameter(name='wintitle', value='ESF AMISR', format='str')
181 opObj14.addParameter(name='showprofile', value='0', format='int')
182 opObj14.addParameter(name='tmin', value=xmin, format='int')
183 opObj14.addParameter(name='tmax', value=xmax, format='int')
185 184 ##opObj11.addParameter(name='ymin', value=dbmin, format='int')
186 185 ##opObj11.addParameter(name='ymax', value=dbmax, format='int')
187 opObj11.addParameter(name='save', value=outPath+'/plots', format='str')
188 opObj11.addParameter(name='show', value = showNOISE, format='int')
189 opObj11.addParameter(name='localtime', value=localtime,format='int')
190
186 opObj14.addParameter(name='save', value=outPath+'/plots', format='str')
187 opObj14.addParameter(name='show', value = showNOISE, format='int')
188 opObj14.addParameter(name='localtime', value=localtime,format='int')
189 opObj14.addParameter(name='exp_code', value='207', format='int')
190 opObj14.addParameter(name='server', value='jro-realtime.igp.gob.pe:4444')
191 opObj14.addParameter(name='sender_period', value='120')
192 opObj14.addParameter(name='tag', value='AMISR')
193 '''
194 patternX : list
195 detail of files to be send must have the following order: local, remote
196 ext, period, exp_code, sub_exp_code
197 '''
198 # ftp = procUnitConfObjSpectraBeam0.addOperation(name='SendToFTP', optype='external')
199 # ftp.addParameter(name='server', value='jro-app.igp.gob.pe')
200 # ftp.addParameter(name='username', value='wmaster')
201 # ftp.addParameter(name='password', value='mst2010vhf')
202 # ftp.addParameter(name='pattern1',
203 # value=outPath+'/plots/rti,/home/wmaster/graficos,png,60,1,1',
204 # format='list')
205 # ftp.addParameter(name='pattern2',
206 # value=outPath+'/plots/rti,/home/wmaster/graficos,png,300,1,1',
207 # format='list')
191 208
192 209
193 210 # print "Escribiendo el archivo XML"
194 211 # controllerObj.writeXml(filename)
195 212 controllerObj.start()
196 213 # print "Leyendo el archivo XML"
197 214 # controllerObj.readXml(filename)
198 215
199 216 if __name__ == '__main__':
200 217 import time
201 218 start_time = time.time()
202 219 main()
203 220 print("--- %s seconds ---" % (time.time() - start_time))
1 NO CONTENT: file was removed, binary diff hidden
General Comments 0
You need to be logged in to leave comments. Login now