##// END OF EJS Templates
casi merge con online_data_hour
José Chávez -
r1036:754fcef10e66 merge
parent child
Show More
@@ -541,8 +541,8 class JRODataIO:
541 return inspect.getargspec(self.run).args
541 return inspect.getargspec(self.run).args
542
542
543 class JRODataReader(JRODataIO):
543 class JRODataReader(JRODataIO):
544
544
545
545 firstTime = True
546 online = 0
546 online = 0
547
547
548 realtime = 0
548 realtime = 0
@@ -578,8 +578,8 class JRODataReader(JRODataIO):
578 selBlocksize = None
578 selBlocksize = None
579
579
580 selBlocktime = None
580 selBlocktime = None
581
581
582
582 onlineWithDate = False
583 def __init__(self):
583 def __init__(self):
584
584
585 """
585 """
@@ -616,7 +616,6 class JRODataReader(JRODataIO):
616 cursor=None,
616 cursor=None,
617 skip=None,
617 skip=None,
618 walk=True):
618 walk=True):
619
620 self.filenameList = []
619 self.filenameList = []
621 self.datetimeList = []
620 self.datetimeList = []
622
621
@@ -682,34 +681,35 class JRODataReader(JRODataIO):
682 print "[Reading] %s -> [%s]" %(filenameList[i], datetimeList[i].ctime())
681 print "[Reading] %s -> [%s]" %(filenameList[i], datetimeList[i].ctime())
683
682
684 self.filenameList = filenameList
683 self.filenameList = filenameList
685 self.datetimeList = datetimeList
684 self.datetimeList = datetimeList
686
687 return pathList, filenameList
685 return pathList, filenameList
688
686
689 def __searchFilesOnLine(self, path, expLabel = "", ext = None, walk=True, set=None):
687 def __searchFilesOnLine(self, path, expLabel="", ext=None, walk=True, set=None, startDate=None, startTime=None):
690
688
691 """
689 """
692 Busca el ultimo archivo de la ultima carpeta (determinada o no por startDateTime) y
690 Busca el ultimo archivo de la ultima carpeta (determinada o no por startDateTime) y
693 devuelve el archivo encontrado ademas de otros datos.
691 devuelve el archivo encontrado ademas de otros datos.
694
692
695 Input:
693 Input:
696 path : carpeta donde estan contenidos los files que contiene data
694 path : carpeta donde estan contenidos los files que contiene data
697
695
698 expLabel : Nombre del subexperimento (subfolder)
696 expLabel : Nombre del subexperimento (subfolder)
699
697
700 ext : extension de los files
698 ext : extension de los files
701
699
702 walk : Si es habilitado no realiza busquedas dentro de los ubdirectorios (doypath)
700 walk : Si es habilitado no realiza busquedas dentro de los subdirectorios (doypath)
703
701
704 Return:
702 Return:
705 directory : eL directorio donde esta el file encontrado
703 directory : eL directorio donde esta el file encontrado
706 filename : el ultimo file de una determinada carpeta
704 filename : el ultimo file de una determinada carpeta
707 year : el anho
705 year : el anho
708 doy : el numero de dia del anho
706 doy : el numero de dia del anho
709 set : el set del archivo
707 set : el set del archivo
710
708
711
709
712 """
710 """
711 pathList = None
712 filenameList = None
713 if not os.path.isdir(path):
713 if not os.path.isdir(path):
714 return None, None, None, None, None, None
714 return None, None, None, None, None, None
715
715
@@ -719,7 +719,7 class JRODataReader(JRODataIO):
719 fullpath = path
719 fullpath = path
720 foldercounter = 0
720 foldercounter = 0
721 else:
721 else:
722 #Filtra solo los directorios
722 # Filtra solo los directorios
723 for thisPath in os.listdir(path):
723 for thisPath in os.listdir(path):
724 if not os.path.isdir(os.path.join(path,thisPath)):
724 if not os.path.isdir(os.path.join(path,thisPath)):
725 continue
725 continue
@@ -755,7 +755,7 class JRODataReader(JRODataIO):
755
755
756 year = int( filename[1:5] )
756 year = int( filename[1:5] )
757 doy = int( filename[5:8] )
757 doy = int( filename[5:8] )
758 set = int( filename[8:11] )
758 set = int( filename[8:11] )
759
759
760 return fullpath, foldercounter, filename, year, doy, set
760 return fullpath, foldercounter, filename, year, doy, set
761
761
@@ -767,7 +767,7 class JRODataReader(JRODataIO):
767 idFile += 1
767 idFile += 1
768 if not(idFile < len(self.filenameList)):
768 if not(idFile < len(self.filenameList)):
769 self.flagNoMoreFiles = 1
769 self.flagNoMoreFiles = 1
770 # print "[Reading] No more Files"
770 # print "[Reading] No more Files"
771 return 0
771 return 0
772
772
773 filename = self.filenameList[idFile]
773 filename = self.filenameList[idFile]
@@ -785,31 +785,32 class JRODataReader(JRODataIO):
785 self.fileSize = fileSize
785 self.fileSize = fileSize
786 self.fp = fp
786 self.fp = fp
787
787
788 # print "[Reading] Setting the file: %s"%self.filename
788 #print "[Reading] Setting the file: %s"%self.filename
789
789
790 return 1
790 return 1
791
791
792 def __setNextFileOnline(self):
792 def __setNextFileOnline(self):
793 """
793 """
794 Busca el siguiente file que tenga suficiente data para ser leida, dentro de un folder especifico, si
794 Busca el siguiente file que tenga suficiente data para ser leida, dentro de un folder especifico, si
795 no encuentra un file valido espera un tiempo determinado y luego busca en los posibles n files
795 no encuentra un file valido espera un tiempo determinado y luego busca en los posibles n files
796 siguientes.
796 siguientes.
797
797
798 Affected:
798 Affected:
799 self.flagIsNewFile
799 self.flagIsNewFile
800 self.filename
800 self.filename
801 self.fileSize
801 self.fileSize
802 self.fp
802 self.fp
803 self.set
803 self.set
804 self.flagNoMoreFiles
804 self.flagNoMoreFiles
805
805
806 Return:
806 Return:
807 0 : si luego de una busqueda del siguiente file valido este no pudo ser encontrado
807 0 : si luego de una busqueda del siguiente file valido este no pudo ser encontrado
808 1 : si el file fue abierto con exito y esta listo a ser leido
808 1 : si el file fue abierto con exito y esta listo a ser leido
809
809
810 Excepciones:
810 Excepciones:
811 Si un determinado file no puede ser abierto
811 Si un determinado file no puede ser abierto
812 """
812 """
813
813 nFiles = 0
814 nFiles = 0
814 fileOk_flag = False
815 fileOk_flag = False
815 firstTime_flag = True
816 firstTime_flag = True
@@ -882,13 +883,34 class JRODataReader(JRODataIO):
882 def setNextFile(self):
883 def setNextFile(self):
883 if self.fp != None:
884 if self.fp != None:
884 self.fp.close()
885 self.fp.close()
885
886 if self.online:
886 if self.online:
887 newFile = self.__setNextFileOnline()
887 newFile = self.__setNextFileOnline()
888 else:
888 else:
889 newFile = self.__setNextFileOffline()
889 newFile = self.__setNextFileOffline()
890
891 if not(newFile):
890 if not(newFile):
891 if self.onlineWithDate is True:
892 self.onlineWithDate=False
893 self.online = True
894 self.firstTime = False
895 self.setup(
896 path=self.path,
897 startDate=self.startDate,
898 endDate=self.endDate,
899 startTime=self.startTime ,
900 endTime=self.endTime,
901 set=self.set,
902 expLabel=self.expLabel,
903 ext=self.ext,
904 online=self.online,
905 delay=self.delay,
906 walk=self.walk,
907 getblock=self.getblock,
908 nTxs=self.nTxs,
909 realtime=self.realtime,
910 blocksize=self.blocksize,
911 blocktime=self.blocktime
912 )
913 return 1
892 print '[Reading] No more files to read'
914 print '[Reading] No more files to read'
893 return 0
915 return 0
894
916
@@ -1046,12 +1068,9 class JRODataReader(JRODataIO):
1046 if not(self.__setNewBlock()):
1068 if not(self.__setNewBlock()):
1047 print 'returning'
1069 print 'returning'
1048 return 0
1070 return 0
1049
1050 if not(self.readBlock()):
1071 if not(self.readBlock()):
1051 return 0
1072 return 0
1052
1053 self.getBasicHeader()
1073 self.getBasicHeader()
1054
1055 if not isTimeInRange(self.dataOut.datatime.time(), self.startTime, self.endTime):
1074 if not isTimeInRange(self.dataOut.datatime.time(), self.startTime, self.endTime):
1056
1075
1057 print "[Reading] Block No. %d/%d -> %s [Skipping]" %(self.nReadBlocks,
1076 print "[Reading] Block No. %d/%d -> %s [Skipping]" %(self.nReadBlocks,
@@ -1328,6 +1347,7 class JRODataReader(JRODataIO):
1328 walk=walk, cursor=cursor,
1347 walk=walk, cursor=cursor,
1329 skip=skip, queue=queue)
1348 skip=skip, queue=queue)
1330
1349
1350 <<<<<<< HEAD
1331 if not(pathList):
1351 if not(pathList):
1332 # print "[Reading] No *%s files in %s (%s - %s)"%(ext, path,
1352 # print "[Reading] No *%s files in %s (%s - %s)"%(ext, path,
1333 # datetime.datetime.combine(startDate,startTime).ctime(),
1353 # datetime.datetime.combine(startDate,startTime).ctime(),
@@ -1340,6 +1360,129 class JRODataReader(JRODataIO):
1340 self.filenameList = []
1360 self.filenameList = []
1341 return
1361 return
1342
1362
1363 =======
1364 if path == None:
1365 raise ValueError, "[Reading] The path is not valid"
1366
1367
1368 if ext == None:
1369 ext = self.ext
1370
1371 self.path = path
1372 self.startDate = startDate
1373 self.endDate = endDate
1374 self.startTime = startTime
1375 self.endTime = endTime
1376 self.set = set
1377 self.expLabel = expLabel
1378 self.ext = ext
1379 self.online = online
1380 self.delay = delay
1381 self.walk = walk
1382 self.getblock = getblock
1383 self.nTxs = nTxs
1384 self.realtime = realtime
1385 self.blocksize = blocksize
1386 self.blocktime = blocktime
1387
1388
1389 if self.firstTime is True:
1390 pathList, filenameList = self.__searchFilesOffLine(path, startDate=startDate, endDate=endDate,
1391 startTime=startTime, endTime=endTime,
1392 set=set, expLabel=expLabel, ext=ext,
1393 walk=walk)
1394 filenameList = filenameList[:-1]
1395
1396 if pathList is not None and filenameList is not None and online:
1397 self.onlineWithDate = True
1398 online = False
1399 self.fileIndex = -1
1400 self.pathList = pathList
1401 self.filenameList = filenameList
1402 file_name = os.path.basename(filenameList[-1])
1403 basename, ext = os.path.splitext(file_name)
1404 last_set = int(basename[-3:])
1405
1406 if online:
1407 print "[Reading] Searching files in online mode..."
1408
1409 for nTries in range(self.nTries):
1410 fullpath, foldercounter, file, year, doy, set = self.__searchFilesOnLine(path=path,
1411 expLabel=expLabel,
1412 ext=ext,
1413 walk=walk,
1414 startDate=startDate,
1415 startTime=startTime,
1416 set=set)
1417
1418 if fullpath:
1419 break
1420 print '[Reading] Waiting %0.2f sec for an valid file in %s: try %02d ...' % (self.delay, path, nTries+1)
1421 sleep( self.delay )
1422
1423 if not(fullpath):
1424 print "[Reading] There 'isn't any valid file in %s" % path
1425 return
1426
1427 self.year = year
1428 self.doy = doy
1429 self.set = set - 1
1430 self.path = path
1431 self.foldercounter = foldercounter
1432 last_set = None
1433
1434 else:
1435 print "[Reading] Searching files in offline mode ..."
1436 pathList, filenameList = self.__searchFilesOffLine(path, startDate=startDate, endDate=endDate,
1437 startTime=startTime, endTime=endTime,
1438 set=set, expLabel=expLabel, ext=ext,
1439 walk=walk)
1440
1441 if not(pathList):
1442 # print "[Reading] No *%s files in %s (%s - %s)"%(ext, path,
1443 # datetime.datetime.combine(startDate,startTime).ctime(),
1444 # datetime.datetime.combine(endDate,endTime).ctime())
1445
1446 # sys.exit(-1)
1447
1448 self.fileIndex = -1
1449 self.pathList = []
1450 self.filenameList = []
1451 return
1452
1453 self.fileIndex = -1
1454 self.pathList = pathList
1455 self.filenameList = filenameList
1456 file_name = os.path.basename(filenameList[-1])
1457 basename, ext = os.path.splitext(file_name)
1458 last_set = int(basename[-3:])
1459
1460
1461 self.online = online
1462 self.realtime = realtime
1463 self.delay = delay
1464 ext = ext.lower()
1465 self.ext = ext
1466 self.getByBlock = getblock
1467 self.nTxs = nTxs
1468 self.startTime = startTime
1469 self.endTime = endTime
1470
1471
1472 #Added-----------------
1473 self.selBlocksize = blocksize
1474 self.selBlocktime = blocktime
1475
1476
1477 if not(self.setNextFile()):
1478 if (startDate!=None) and (endDate!=None):
1479 print "[Reading] No files in range: %s - %s" %(datetime.datetime.combine(startDate,startTime).ctime(), datetime.datetime.combine(endDate,endTime).ctime())
1480 elif startDate != None:
1481 print "[Reading] No files in range: %s" %(datetime.datetime.combine(startDate,startTime).ctime())
1482 else:
1483 print "[Reading] No files"
1484
1485 >>>>>>> online_data_hour
1343 self.fileIndex = -1
1486 self.fileIndex = -1
1344 self.pathList = pathList
1487 self.pathList = pathList
1345 self.filenameList = filenameList
1488 self.filenameList = filenameList
@@ -1365,6 +1508,7 class JRODataReader(JRODataIO):
1365 self.verbose = verbose
1508 self.verbose = verbose
1366 self.warnings = warnings
1509 self.warnings = warnings
1367
1510
1511 <<<<<<< HEAD
1368 if not(self.setNextFile()):
1512 if not(self.setNextFile()):
1369 if (startDate!=None) and (endDate!=None):
1513 if (startDate!=None) and (endDate!=None):
1370 print "[Reading] No files in range: %s - %s" %(datetime.datetime.combine(startDate,startTime).ctime(), datetime.datetime.combine(endDate,endTime).ctime())
1514 print "[Reading] No files in range: %s - %s" %(datetime.datetime.combine(startDate,startTime).ctime(), datetime.datetime.combine(endDate,endTime).ctime())
@@ -1383,6 +1527,13 class JRODataReader(JRODataIO):
1383 if last_set != None:
1527 if last_set != None:
1384 self.dataOut.last_block = last_set * self.processingHeaderObj.dataBlocksPerFile + self.basicHeaderObj.dataBlock
1528 self.dataOut.last_block = last_set * self.processingHeaderObj.dataBlocksPerFile + self.basicHeaderObj.dataBlock
1385 return
1529 return
1530 =======
1531 # self.getBasicHeader()
1532
1533 if last_set != None:
1534 self.dataOut.last_block = last_set * self.processingHeaderObj.dataBlocksPerFile + self.basicHeaderObj.dataBlock
1535 return
1536 >>>>>>> online_data_hour
1386
1537
1387 def getBasicHeader(self):
1538 def getBasicHeader(self):
1388
1539
@@ -1399,10 +1550,10 class JRODataReader(JRODataIO):
1399 self.dataOut.useLocalTime = self.basicHeaderObj.useLocalTime
1550 self.dataOut.useLocalTime = self.basicHeaderObj.useLocalTime
1400
1551
1401 self.dataOut.ippSeconds = self.radarControllerHeaderObj.ippSeconds/self.nTxs
1552 self.dataOut.ippSeconds = self.radarControllerHeaderObj.ippSeconds/self.nTxs
1402
1553
1403 # self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock*self.nTxs
1554 # self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock*self.nTxs
1404
1555
1405
1556
1406 def getFirstHeader(self):
1557 def getFirstHeader(self):
1407
1558
1408 raise NotImplementedError
1559 raise NotImplementedError
@@ -1476,6 +1627,7 class JRODataReader(JRODataIO):
1476 verbose=True, **kwargs):
1627 verbose=True, **kwargs):
1477
1628
1478 if not(self.isConfig):
1629 if not(self.isConfig):
1630 <<<<<<< HEAD
1479 # self.dataOut = dataOut
1631 # self.dataOut = dataOut
1480 self.setup( path=path,
1632 self.setup( path=path,
1481 startDate=startDate,
1633 startDate=startDate,
@@ -1499,6 +1651,11 class JRODataReader(JRODataIO):
1499 warnings=warnings,
1651 warnings=warnings,
1500 server=server,
1652 server=server,
1501 verbose=verbose)
1653 verbose=verbose)
1654 =======
1655
1656 # self.dataOut = dataOut
1657 self.setup(**kwargs)
1658 >>>>>>> online_data_hour
1502 self.isConfig = True
1659 self.isConfig = True
1503 if server is None:
1660 if server is None:
1504 self.getData()
1661 self.getData()
@@ -1621,9 +1778,15 class JRODataWriter(JRODataIO):
1621 Return:
1778 Return:
1622 None
1779 None
1623 """
1780 """
1781 <<<<<<< HEAD
1624
1782
1625 # CALCULAR PARAMETROS
1783 # CALCULAR PARAMETROS
1626
1784
1785 =======
1786
1787 # CALCULAR PARAMETROS
1788
1789 >>>>>>> online_data_hour
1627 sizeLongHeader = self.systemHeaderObj.size + self.radarControllerHeaderObj.size + self.processingHeaderObj.size
1790 sizeLongHeader = self.systemHeaderObj.size + self.radarControllerHeaderObj.size + self.processingHeaderObj.size
1628 self.basicHeaderObj.size = self.basicHeaderSize + sizeLongHeader
1791 self.basicHeaderObj.size = self.basicHeaderSize + sizeLongHeader
1629
1792
@@ -180,13 +180,20 class VoltageReader(JRODataReader, ProcessingUnit):
180
180
181 def getBlockDimension(self):
181 def getBlockDimension(self):
182 """
182 """
183 <<<<<<< HEAD
183 Obtiene la cantidad de puntos a leer por cada bloque de datos
184 Obtiene la cantidad de puntos a leer por cada bloque de datos
184
185
185 Affected:
186 Affected:
186 self.blocksize
187 self.blocksize
187
188 =======
188 Return:
189 Obtiene la cantidad de puntos a leer por cada bloque de datos
189 None
190
191 Affected:
192 self.blocksize
193 >>>>>>> online_data_hour
194
195 Return:
196 None
190 """
197 """
191 pts2read = self.processingHeaderObj.profilesPerBlock * self.processingHeaderObj.nHeights * self.systemHeaderObj.nChannels
198 pts2read = self.processingHeaderObj.profilesPerBlock * self.processingHeaderObj.nHeights * self.systemHeaderObj.nChannels
192 self.blocksize = pts2read
199 self.blocksize = pts2read
@@ -195,6 +202,7 class VoltageReader(JRODataReader, ProcessingUnit):
195
202
196 def readBlock(self):
203 def readBlock(self):
197 """
204 """
205 <<<<<<< HEAD
198 readBlock lee el bloque de datos desde la posicion actual del puntero del archivo
206 readBlock lee el bloque de datos desde la posicion actual del puntero del archivo
199 (self.fp) y actualiza todos los parametros relacionados al bloque de datos
207 (self.fp) y actualiza todos los parametros relacionados al bloque de datos
200 (metadata + data). La data leida es almacenada en el buffer y el contador del buffer
208 (metadata + data). La data leida es almacenada en el buffer y el contador del buffer
@@ -215,6 +223,28 class VoltageReader(JRODataReader, ProcessingUnit):
215
223
216 Exceptions:
224 Exceptions:
217 Si un bloque leido no es un bloque valido
225 Si un bloque leido no es un bloque valido
226 =======
227 readBlock lee el bloque de datos desde la posicion actual del puntero del archivo
228 (self.fp) y actualiza todos los parametros relacionados al bloque de datos
229 (metadata + data). La data leida es almacenada en el buffer y el contador del buffer
230 es seteado a 0
231
232 Inputs:
233 None
234
235 Return:
236 None
237
238 Affected:
239 self.profileIndex
240 self.datablock
241 self.flagIsNewFile
242 self.flagIsNewBlock
243 self.nTotalBlocks
244
245 Exceptions:
246 Si un bloque leido no es un bloque valido
247 >>>>>>> online_data_hour
218 """
248 """
219
249
220 # if self.server is not None:
250 # if self.server is not None:
@@ -408,6 +438,7 class VoltageReader(JRODataReader, ProcessingUnit):
408
438
409 def getData(self):
439 def getData(self):
410 """
440 """
441 <<<<<<< HEAD
411 getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut
442 getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut
412 del tipo "Voltage" con todos los parametros asociados a este (metadata). cuando no hay datos
443 del tipo "Voltage" con todos los parametros asociados a este (metadata). cuando no hay datos
413 en el buffer de lectura es necesario hacer una nueva lectura de los bloques de datos usando
444 en el buffer de lectura es necesario hacer una nueva lectura de los bloques de datos usando
@@ -441,6 +472,41 class VoltageReader(JRODataReader, ProcessingUnit):
441 self.profileIndex
472 self.profileIndex
442 self.flagDiscontinuousBlock
473 self.flagDiscontinuousBlock
443 self.flagIsNewBlock
474 self.flagIsNewBlock
475 =======
476 getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut
477 del tipo "Voltage" con todos los parametros asociados a este (metadata). cuando no hay datos
478 en el buffer de lectura es necesario hacer una nueva lectura de los bloques de datos usando
479 "readNextBlock"
480
481 Ademas incrementa el contador del buffer "self.profileIndex" en 1.
482
483 Return:
484
485 Si el flag self.getByBlock ha sido seteado el bloque completo es copiado a self.dataOut y el self.profileIndex
486 es igual al total de perfiles leidos desde el archivo.
487
488 Si self.getByBlock == False:
489
490 self.dataOut.data = buffer[:, thisProfile, :]
491
492 shape = [nChannels, nHeis]
493
494 Si self.getByBlock == True:
495
496 self.dataOut.data = buffer[:, :, :]
497
498 shape = [nChannels, nProfiles, nHeis]
499
500 Variables afectadas:
501 self.dataOut
502 self.profileIndex
503
504 Affected:
505 self.dataOut
506 self.profileIndex
507 self.flagDiscontinuousBlock
508 self.flagIsNewBlock
509 >>>>>>> online_data_hour
444 """
510 """
445 if self.flagNoMoreFiles:
511 if self.flagNoMoreFiles:
446 self.dataOut.flagNoData = True
512 self.dataOut.flagNoData = True
@@ -462,16 +528,24 class VoltageReader(JRODataReader, ProcessingUnit):
462 if not self.getByBlock:
528 if not self.getByBlock:
463
529
464 """
530 """
531 <<<<<<< HEAD
465 Return profile by profile
532 Return profile by profile
466
533
467 If nTxs > 1 then one profile is divided by nTxs and number of total
534 If nTxs > 1 then one profile is divided by nTxs and number of total
468 blocks is increased by nTxs (nProfiles *= nTxs)
535 blocks is increased by nTxs (nProfiles *= nTxs)
536 =======
537 Return profile by profile
538
539 If nTxs > 1 then one profile is divided by nTxs and number of total
540 blocks is increased by nTxs (nProfiles *= nTxs)
541 >>>>>>> online_data_hour
469 """
542 """
470 self.dataOut.flagDataAsBlock = False
543 self.dataOut.flagDataAsBlock = False
471 self.dataOut.data = self.datablock[:,self.profileIndex,:]
544 self.dataOut.data = self.datablock[:,self.profileIndex,:]
472 self.dataOut.profileIndex = self.profileIndex
545 self.dataOut.profileIndex = self.profileIndex
473
546
474 self.profileIndex += 1
547 self.profileIndex += 1
548 <<<<<<< HEAD
475
549
476 # elif self.selBlocksize==None or self.selBlocksize==self.dataOut.nProfiles:
550 # elif self.selBlocksize==None or self.selBlocksize==self.dataOut.nProfiles:
477 # """
551 # """
@@ -483,9 +557,22 class VoltageReader(JRODataReader, ProcessingUnit):
483 #
557 #
484 # self.profileIndex = self.dataOut.nProfiles
558 # self.profileIndex = self.dataOut.nProfiles
485
559
560 =======
561
562 # elif self.selBlocksize==None or self.selBlocksize==self.dataOut.nProfiles:
563 # """
564 # Return all block
565 # """
566 # self.dataOut.flagDataAsBlock = True
567 # self.dataOut.data = self.datablock
568 # self.dataOut.profileIndex = self.dataOut.nProfiles - 1
569 #
570 # self.profileIndex = self.dataOut.nProfiles
571
572 >>>>>>> online_data_hour
486 else:
573 else:
487 """
574 """
488 Return a block
575 Return a block
489 """
576 """
490 if self.selBlocksize == None: self.selBlocksize = self.dataOut.nProfiles
577 if self.selBlocksize == None: self.selBlocksize = self.dataOut.nProfiles
491 if self.selBlocktime != None:
578 if self.selBlocktime != None:
@@ -166,12 +166,21 class Remote(Thread):
166 return 0
166 return 0
167
167
168 self.mutex.acquire()
168 self.mutex.acquire()
169 <<<<<<< HEAD
169 # init = time.time()
170 # init = time.time()
170 #
171 #
171 # while(self.bussy):
172 # while(self.bussy):
172 # sleep(0.1)
173 # sleep(0.1)
173 # if time.time() - init > 2*self.period:
174 # if time.time() - init > 2*self.period:
174 # return 0
175 # return 0
176 =======
177 # init = time.time()
178 #
179 # while(self.bussy):
180 # sleep(0.1)
181 # if time.time() - init > 2*self.period:
182 # return 0
183 >>>>>>> online_data_hour
175
184
176 self.fileList = fileList
185 self.fileList = fileList
177 self.mutex.release()
186 self.mutex.release()
@@ -196,7 +205,11 class Remote(Thread):
196 if self.stopFlag:
205 if self.stopFlag:
197 break
206 break
198
207
208 <<<<<<< HEAD
199 # self.bussy = True
209 # self.bussy = True
210 =======
211 # self.bussy = True
212 >>>>>>> online_data_hour
200 self.mutex.acquire()
213 self.mutex.acquire()
201
214
202 print "[Remote Server] Opening %s" %self.__server
215 print "[Remote Server] Opening %s" %self.__server
@@ -619,6 +632,7 class SendToServer(ProcessingUnit):
619 filenameList = glob.glob1(thisFolder, '*%s' %self.ext)
632 filenameList = glob.glob1(thisFolder, '*%s' %self.ext)
620
633
621 if len(filenameList) < 1:
634 if len(filenameList) < 1:
635
622 continue
636 continue
623
637
624 for thisFile in filenameList:
638 for thisFile in filenameList:
@@ -55,17 +55,26 opObj00.addParameter(name='channelList', value='0,1,2,3,4', format='intlist')
55 opObj01 = procUnitConfObj0.addOperation(name='setRadarFrequency')
55 opObj01 = procUnitConfObj0.addOperation(name='setRadarFrequency')
56 opObj01.addParameter(name='frequency', value='30.e6', format='float')
56 opObj01.addParameter(name='frequency', value='30.e6', format='float')
57
57
58 opObj01 = procUnitConfObj0.addOperation(name='interpolateHeights')
58 # opObj01 = procUnitConfObj0.addOperation(name='interpolateHeights')
59 opObj01.addParameter(name='topLim', value='73', format='int')
59 # opObj01.addParameter(name='topLim', value='73', format='int')
60 opObj01.addParameter(name='botLim', value='71', format='int')
60 # opObj01.addParameter(name='botLim', value='71', format='int')
61
61
62 opObj02 = procUnitConfObj0.addOperation(name='Decoder', optype='other')
62 opObj02 = procUnitConfObj0.addOperation(name='Decoder', optype='other')
63
63
64 opObj03 = procUnitConfObj0.addOperation(name='CohInt', optype='other')
64 opObj03 = procUnitConfObj0.addOperation(name='CohInt', optype='other')
65 opObj03.addParameter(name='n', value='2', format='int')
65 opObj03.addParameter(name='n', value='2', format='int')
66
66
67 procUnitConfObj1 = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObj0.getId())
68 opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='other')
69 opObj11.addParameter(name='id', value='237', format='int')
70 opObj11.addParameter(name='xmin', value='9.0', format='float')
71 opObj11.addParameter(name='xmax', value='16.0', format='float')
72 opObj11.addParameter(name='zmin', value='15.0', format='float')
73 opObj11.addParameter(name='zmax', value='50.0', format='float')
74
67 #--------------------------- Parameters Processing Unit ------------------------------------
75 #--------------------------- Parameters Processing Unit ------------------------------------
68
76
77 <<<<<<< HEAD
69 procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObj0.getId())
78 procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObj0.getId())
70 #
79 #
71 opObj10 = procUnitConfObj1.addOperation(name='SMDetection', optype='other')
80 opObj10 = procUnitConfObj1.addOperation(name='SMDetection', optype='other')
@@ -83,3 +92,23 opObj12.addParameter(name='mode',value='2',format='int')
83 #--------------------------------------------------------------------------------------------------
92 #--------------------------------------------------------------------------------------------------
84
93
85 controllerObj.start()
94 controllerObj.start()
95 =======
96 # procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObj0.getId())
97 # #
98 # opObj10 = procUnitConfObj1.addOperation(name='SMDetection', optype='other')
99 # opObj10.addParameter(name='azimuth', value='45', format='float')
100 # opObj10.addParameter(name='hmin', value='60', format='float')
101 # opObj10.addParameter(name='hmax', value='120', format='float')
102
103 # opObj12 = procUnitConfObj1.addOperation(name='ParamWriter', optype='other')
104 # opObj12.addParameter(name='path', value=pathfile)
105 # opObj12.addParameter(name='blocksPerFile', value='1000', format='int')
106 # opObj12.addParameter(name='metadataList',value='type,heightList,paramInterval,timeZone',format='list')
107 # opObj12.addParameter(name='dataList',value='data_param,utctime',format='list')
108 # opObj12.addParameter(name='mode',value='2',format='int')
109
110 #--------------------------------------------------------------------------------------------------
111 controllerObj.createObjects()
112 controllerObj.connectObjects()
113 controllerObj.run()
114 >>>>>>> online_data_hour
General Comments 0
You need to be logged in to leave comments. Login now