@@ -541,8 +541,8 class JRODataIO: | |||
|
541 | 541 | return inspect.getargspec(self.run).args |
|
542 | 542 | |
|
543 | 543 | class JRODataReader(JRODataIO): |
|
544 | ||
|
545 | ||
|
544 | ||
|
545 | firstTime = True | |
|
546 | 546 | online = 0 |
|
547 | 547 | |
|
548 | 548 | realtime = 0 |
@@ -578,8 +578,8 class JRODataReader(JRODataIO): | |||
|
578 | 578 | selBlocksize = None |
|
579 | 579 | |
|
580 | 580 | selBlocktime = None |
|
581 | ||
|
582 | ||
|
581 | ||
|
582 | onlineWithDate = False | |
|
583 | 583 | def __init__(self): |
|
584 | 584 | |
|
585 | 585 | """ |
@@ -616,7 +616,6 class JRODataReader(JRODataIO): | |||
|
616 | 616 | cursor=None, |
|
617 | 617 | skip=None, |
|
618 | 618 | walk=True): |
|
619 | ||
|
620 | 619 | self.filenameList = [] |
|
621 | 620 | self.datetimeList = [] |
|
622 | 621 | |
@@ -682,34 +681,35 class JRODataReader(JRODataIO): | |||
|
682 | 681 | print "[Reading] %s -> [%s]" %(filenameList[i], datetimeList[i].ctime()) |
|
683 | 682 | |
|
684 | 683 | self.filenameList = filenameList |
|
685 | self.datetimeList = datetimeList | |
|
686 | ||
|
684 | self.datetimeList = datetimeList | |
|
687 | 685 | return pathList, filenameList |
|
688 | 686 | |
|
689 |
def __searchFilesOnLine(self, path, expLabel |
|
|
690 | ||
|
687 | def __searchFilesOnLine(self, path, expLabel="", ext=None, walk=True, set=None, startDate=None, startTime=None): | |
|
688 | ||
|
691 | 689 |
|
|
692 | Busca el ultimo archivo de la ultima carpeta (determinada o no por startDateTime) y | |
|
693 | devuelve el archivo encontrado ademas de otros datos. | |
|
694 | ||
|
695 | Input: | |
|
696 | path : carpeta donde estan contenidos los files que contiene data | |
|
697 | ||
|
698 | expLabel : Nombre del subexperimento (subfolder) | |
|
699 | ||
|
700 |
ext |
|
|
701 | ||
|
702 | walk : Si es habilitado no realiza busquedas dentro de los ubdirectorios (doypath) | |
|
703 | ||
|
704 | Return: | |
|
705 | directory : eL directorio donde esta el file encontrado | |
|
706 | filename : el ultimo file de una determinada carpeta | |
|
707 | year : el anho | |
|
708 | doy : el numero de dia del anho | |
|
709 | set : el set del archivo | |
|
710 | ||
|
711 | ||
|
690 | Busca el ultimo archivo de la ultima carpeta (determinada o no por startDateTime) y | |
|
691 | devuelve el archivo encontrado ademas de otros datos. | |
|
692 | ||
|
693 | Input: | |
|
694 | path : carpeta donde estan contenidos los files que contiene data | |
|
695 | ||
|
696 | expLabel : Nombre del subexperimento (subfolder) | |
|
697 | ||
|
698 | ext : extension de los files | |
|
699 | ||
|
700 | walk : Si es habilitado no realiza busquedas dentro de los subdirectorios (doypath) | |
|
701 | ||
|
702 | Return: | |
|
703 | directory : eL directorio donde esta el file encontrado | |
|
704 | filename : el ultimo file de una determinada carpeta | |
|
705 | year : el anho | |
|
706 | doy : el numero de dia del anho | |
|
707 | set : el set del archivo | |
|
708 | ||
|
709 | ||
|
712 | 710 | """ |
|
711 | pathList = None | |
|
712 | filenameList = None | |
|
713 | 713 | if not os.path.isdir(path): |
|
714 | 714 | return None, None, None, None, None, None |
|
715 | 715 | |
@@ -719,7 +719,7 class JRODataReader(JRODataIO): | |||
|
719 | 719 | fullpath = path |
|
720 | 720 | foldercounter = 0 |
|
721 | 721 | else: |
|
722 | #Filtra solo los directorios | |
|
722 | # Filtra solo los directorios | |
|
723 | 723 | for thisPath in os.listdir(path): |
|
724 | 724 | if not os.path.isdir(os.path.join(path,thisPath)): |
|
725 | 725 | continue |
@@ -755,7 +755,7 class JRODataReader(JRODataIO): | |||
|
755 | 755 | |
|
756 | 756 | year = int( filename[1:5] ) |
|
757 | 757 | doy = int( filename[5:8] ) |
|
758 | set = int( filename[8:11] ) | |
|
758 | set = int( filename[8:11] ) | |
|
759 | 759 | |
|
760 | 760 | return fullpath, foldercounter, filename, year, doy, set |
|
761 | 761 | |
@@ -767,7 +767,7 class JRODataReader(JRODataIO): | |||
|
767 | 767 | idFile += 1 |
|
768 | 768 | if not(idFile < len(self.filenameList)): |
|
769 | 769 | self.flagNoMoreFiles = 1 |
|
770 |
|
|
|
770 | # print "[Reading] No more Files" | |
|
771 | 771 | return 0 |
|
772 | 772 | |
|
773 | 773 | filename = self.filenameList[idFile] |
@@ -785,31 +785,32 class JRODataReader(JRODataIO): | |||
|
785 | 785 | self.fileSize = fileSize |
|
786 | 786 | self.fp = fp |
|
787 | 787 | |
|
788 |
# |
|
|
788 | #print "[Reading] Setting the file: %s"%self.filename | |
|
789 | 789 | |
|
790 | 790 | return 1 |
|
791 | 791 | |
|
792 | 792 | def __setNextFileOnline(self): |
|
793 | 793 | """ |
|
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 | |
|
796 | siguientes. | |
|
797 | ||
|
798 | Affected: | |
|
799 | self.flagIsNewFile | |
|
800 | self.filename | |
|
801 | self.fileSize | |
|
802 | self.fp | |
|
803 | self.set | |
|
804 | self.flagNoMoreFiles | |
|
805 | ||
|
806 | Return: | |
|
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 | |
|
809 | ||
|
810 | Excepciones: | |
|
811 | Si un determinado file no puede ser abierto | |
|
812 | """ | |
|
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 | |
|
796 | siguientes. | |
|
797 | ||
|
798 | Affected: | |
|
799 | self.flagIsNewFile | |
|
800 | self.filename | |
|
801 | self.fileSize | |
|
802 | self.fp | |
|
803 | self.set | |
|
804 | self.flagNoMoreFiles | |
|
805 | ||
|
806 | Return: | |
|
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 | |
|
809 | ||
|
810 | Excepciones: | |
|
811 | Si un determinado file no puede ser abierto | |
|
812 | """ | |
|
813 | ||
|
813 | 814 | nFiles = 0 |
|
814 | 815 | fileOk_flag = False |
|
815 | 816 | firstTime_flag = True |
@@ -882,13 +883,34 class JRODataReader(JRODataIO): | |||
|
882 | 883 | def setNextFile(self): |
|
883 | 884 | if self.fp != None: |
|
884 | 885 | self.fp.close() |
|
885 | ||
|
886 | 886 | if self.online: |
|
887 | 887 | newFile = self.__setNextFileOnline() |
|
888 | 888 | else: |
|
889 | 889 | newFile = self.__setNextFileOffline() |
|
890 | ||
|
891 | 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 | 914 | print '[Reading] No more files to read' |
|
893 | 915 | return 0 |
|
894 | 916 | |
@@ -1046,12 +1068,9 class JRODataReader(JRODataIO): | |||
|
1046 | 1068 | if not(self.__setNewBlock()): |
|
1047 | 1069 | print 'returning' |
|
1048 | 1070 | return 0 |
|
1049 | ||
|
1050 | 1071 | if not(self.readBlock()): |
|
1051 | 1072 | return 0 |
|
1052 | ||
|
1053 | 1073 | self.getBasicHeader() |
|
1054 | ||
|
1055 | 1074 | if not isTimeInRange(self.dataOut.datatime.time(), self.startTime, self.endTime): |
|
1056 | 1075 | |
|
1057 | 1076 | print "[Reading] Block No. %d/%d -> %s [Skipping]" %(self.nReadBlocks, |
@@ -1328,6 +1347,7 class JRODataReader(JRODataIO): | |||
|
1328 | 1347 | walk=walk, cursor=cursor, |
|
1329 | 1348 | skip=skip, queue=queue) |
|
1330 | 1349 | |
|
1350 | <<<<<<< HEAD | |
|
1331 | 1351 | if not(pathList): |
|
1332 | 1352 | # print "[Reading] No *%s files in %s (%s - %s)"%(ext, path, |
|
1333 | 1353 | # datetime.datetime.combine(startDate,startTime).ctime(), |
@@ -1340,6 +1360,129 class JRODataReader(JRODataIO): | |||
|
1340 | 1360 | self.filenameList = [] |
|
1341 | 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 | 1486 | self.fileIndex = -1 |
|
1344 | 1487 | self.pathList = pathList |
|
1345 | 1488 | self.filenameList = filenameList |
@@ -1365,6 +1508,7 class JRODataReader(JRODataIO): | |||
|
1365 | 1508 | self.verbose = verbose |
|
1366 | 1509 | self.warnings = warnings |
|
1367 | 1510 | |
|
1511 | <<<<<<< HEAD | |
|
1368 | 1512 | if not(self.setNextFile()): |
|
1369 | 1513 | if (startDate!=None) and (endDate!=None): |
|
1370 | 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 | 1527 | if last_set != None: |
|
1384 | 1528 | self.dataOut.last_block = last_set * self.processingHeaderObj.dataBlocksPerFile + self.basicHeaderObj.dataBlock |
|
1385 | 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 | 1538 | def getBasicHeader(self): |
|
1388 | 1539 | |
@@ -1399,10 +1550,10 class JRODataReader(JRODataIO): | |||
|
1399 | 1550 | self.dataOut.useLocalTime = self.basicHeaderObj.useLocalTime |
|
1400 | 1551 | |
|
1401 | 1552 | self.dataOut.ippSeconds = self.radarControllerHeaderObj.ippSeconds/self.nTxs |
|
1402 | ||
|
1403 | # self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock*self.nTxs | |
|
1404 | ||
|
1405 | ||
|
1553 | ||
|
1554 | # self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock*self.nTxs | |
|
1555 | ||
|
1556 | ||
|
1406 | 1557 | def getFirstHeader(self): |
|
1407 | 1558 | |
|
1408 | 1559 | raise NotImplementedError |
@@ -1476,6 +1627,7 class JRODataReader(JRODataIO): | |||
|
1476 | 1627 | verbose=True, **kwargs): |
|
1477 | 1628 | |
|
1478 | 1629 | if not(self.isConfig): |
|
1630 | <<<<<<< HEAD | |
|
1479 | 1631 | # self.dataOut = dataOut |
|
1480 | 1632 | self.setup( path=path, |
|
1481 | 1633 | startDate=startDate, |
@@ -1499,6 +1651,11 class JRODataReader(JRODataIO): | |||
|
1499 | 1651 | warnings=warnings, |
|
1500 | 1652 | server=server, |
|
1501 | 1653 | verbose=verbose) |
|
1654 | ======= | |
|
1655 | ||
|
1656 | # self.dataOut = dataOut | |
|
1657 | self.setup(**kwargs) | |
|
1658 | >>>>>>> online_data_hour | |
|
1502 | 1659 | self.isConfig = True |
|
1503 | 1660 | if server is None: |
|
1504 | 1661 | self.getData() |
@@ -1621,9 +1778,15 class JRODataWriter(JRODataIO): | |||
|
1621 | 1778 | Return: |
|
1622 | 1779 | None |
|
1623 | 1780 | """ |
|
1781 | <<<<<<< HEAD | |
|
1624 | 1782 | |
|
1625 | 1783 | # CALCULAR PARAMETROS |
|
1626 | 1784 | |
|
1785 | ======= | |
|
1786 | ||
|
1787 | # CALCULAR PARAMETROS | |
|
1788 | ||
|
1789 | >>>>>>> online_data_hour | |
|
1627 | 1790 | sizeLongHeader = self.systemHeaderObj.size + self.radarControllerHeaderObj.size + self.processingHeaderObj.size |
|
1628 | 1791 | self.basicHeaderObj.size = self.basicHeaderSize + sizeLongHeader |
|
1629 | 1792 |
@@ -180,13 +180,20 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
180 | 180 | |
|
181 | 181 | def getBlockDimension(self): |
|
182 | 182 | """ |
|
183 | <<<<<<< HEAD | |
|
183 | 184 | Obtiene la cantidad de puntos a leer por cada bloque de datos |
|
184 | 185 | |
|
185 | 186 | Affected: |
|
186 | 187 | self.blocksize |
|
187 | ||
|
188 | Return: | |
|
189 |
|
|
|
188 | ======= | |
|
189 | Obtiene la cantidad de puntos a leer por cada bloque de datos | |
|
190 | ||
|
191 | Affected: | |
|
192 | self.blocksize | |
|
193 | >>>>>>> online_data_hour | |
|
194 | ||
|
195 | Return: | |
|
196 | None | |
|
190 | 197 | """ |
|
191 | 198 | pts2read = self.processingHeaderObj.profilesPerBlock * self.processingHeaderObj.nHeights * self.systemHeaderObj.nChannels |
|
192 | 199 | self.blocksize = pts2read |
@@ -195,6 +202,7 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
195 | 202 | |
|
196 | 203 | def readBlock(self): |
|
197 | 204 | """ |
|
205 | <<<<<<< HEAD | |
|
198 | 206 | readBlock lee el bloque de datos desde la posicion actual del puntero del archivo |
|
199 | 207 | (self.fp) y actualiza todos los parametros relacionados al bloque de datos |
|
200 | 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 | 224 | Exceptions: |
|
217 | 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 | 250 | # if self.server is not None: |
@@ -408,6 +438,7 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
408 | 438 | |
|
409 | 439 | def getData(self): |
|
410 | 440 | """ |
|
441 | <<<<<<< HEAD | |
|
411 | 442 | getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut |
|
412 | 443 | del tipo "Voltage" con todos los parametros asociados a este (metadata). cuando no hay datos |
|
413 | 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 | 472 | self.profileIndex |
|
442 | 473 | self.flagDiscontinuousBlock |
|
443 | 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 | 511 | if self.flagNoMoreFiles: |
|
446 | 512 | self.dataOut.flagNoData = True |
@@ -462,16 +528,24 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
462 | 528 | if not self.getByBlock: |
|
463 | 529 | |
|
464 | 530 | """ |
|
531 | <<<<<<< HEAD | |
|
465 | 532 | Return profile by profile |
|
466 | 533 | |
|
467 | 534 | If nTxs > 1 then one profile is divided by nTxs and number of total |
|
468 | 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 | 543 | self.dataOut.flagDataAsBlock = False |
|
471 | 544 | self.dataOut.data = self.datablock[:,self.profileIndex,:] |
|
472 | 545 | self.dataOut.profileIndex = self.profileIndex |
|
473 | 546 | |
|
474 | 547 | self.profileIndex += 1 |
|
548 | <<<<<<< HEAD | |
|
475 | 549 | |
|
476 | 550 | # elif self.selBlocksize==None or self.selBlocksize==self.dataOut.nProfiles: |
|
477 | 551 | # """ |
@@ -483,9 +557,22 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
483 | 557 | # |
|
484 | 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 | 573 | else: |
|
487 | 574 | """ |
|
488 | Return a block | |
|
575 | Return a block | |
|
489 | 576 | """ |
|
490 | 577 | if self.selBlocksize == None: self.selBlocksize = self.dataOut.nProfiles |
|
491 | 578 | if self.selBlocktime != None: |
@@ -166,12 +166,21 class Remote(Thread): | |||
|
166 | 166 | return 0 |
|
167 | 167 | |
|
168 | 168 | self.mutex.acquire() |
|
169 | <<<<<<< HEAD | |
|
169 | 170 | # init = time.time() |
|
170 | 171 | # |
|
171 | 172 | # while(self.bussy): |
|
172 | 173 | # sleep(0.1) |
|
173 | 174 | # if time.time() - init > 2*self.period: |
|
174 | 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 | 185 | self.fileList = fileList |
|
177 | 186 | self.mutex.release() |
@@ -196,7 +205,11 class Remote(Thread): | |||
|
196 | 205 | if self.stopFlag: |
|
197 | 206 | break |
|
198 | 207 | |
|
208 | <<<<<<< HEAD | |
|
199 | 209 | # self.bussy = True |
|
210 | ======= | |
|
211 | # self.bussy = True | |
|
212 | >>>>>>> online_data_hour | |
|
200 | 213 | self.mutex.acquire() |
|
201 | 214 | |
|
202 | 215 | print "[Remote Server] Opening %s" %self.__server |
@@ -619,6 +632,7 class SendToServer(ProcessingUnit): | |||
|
619 | 632 | filenameList = glob.glob1(thisFolder, '*%s' %self.ext) |
|
620 | 633 | |
|
621 | 634 | if len(filenameList) < 1: |
|
635 | ||
|
622 | 636 | continue |
|
623 | 637 | |
|
624 | 638 | for thisFile in filenameList: |
@@ -55,17 +55,26 opObj00.addParameter(name='channelList', value='0,1,2,3,4', format='intlist') | |||
|
55 | 55 | opObj01 = procUnitConfObj0.addOperation(name='setRadarFrequency') |
|
56 | 56 | opObj01.addParameter(name='frequency', value='30.e6', format='float') |
|
57 | 57 | |
|
58 | opObj01 = procUnitConfObj0.addOperation(name='interpolateHeights') | |
|
59 | opObj01.addParameter(name='topLim', value='73', format='int') | |
|
60 | opObj01.addParameter(name='botLim', value='71', format='int') | |
|
58 | # opObj01 = procUnitConfObj0.addOperation(name='interpolateHeights') | |
|
59 | # opObj01.addParameter(name='topLim', value='73', format='int') | |
|
60 | # opObj01.addParameter(name='botLim', value='71', format='int') | |
|
61 | 61 | |
|
62 | 62 | opObj02 = procUnitConfObj0.addOperation(name='Decoder', optype='other') |
|
63 | 63 | |
|
64 | 64 | opObj03 = procUnitConfObj0.addOperation(name='CohInt', optype='other') |
|
65 | 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 | 75 | #--------------------------- Parameters Processing Unit ------------------------------------ |
|
68 | 76 | |
|
77 | <<<<<<< HEAD | |
|
69 | 78 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObj0.getId()) |
|
70 | 79 | # |
|
71 | 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 | 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