@@ -538,7 +538,7 class JRODataIO: | |||
|
538 | 538 | |
|
539 | 539 | class JRODataReader(JRODataIO): |
|
540 | 540 | |
|
541 | ||
|
541 | firstTime = True | |
|
542 | 542 | online = 0 |
|
543 | 543 | |
|
544 | 544 | realtime = 0 |
@@ -575,7 +575,7 class JRODataReader(JRODataIO): | |||
|
575 | 575 | |
|
576 | 576 | selBlocktime = None |
|
577 | 577 | |
|
578 | ||
|
578 | onlineWithDate = False | |
|
579 | 579 | def __init__(self): |
|
580 | 580 | |
|
581 | 581 | """ |
@@ -609,7 +609,6 class JRODataReader(JRODataIO): | |||
|
609 | 609 | expLabel='', |
|
610 | 610 | ext='.r', |
|
611 | 611 | walk=True): |
|
612 | ||
|
613 | 612 | self.filenameList = [] |
|
614 | 613 | self.datetimeList = [] |
|
615 | 614 | |
@@ -663,32 +662,35 class JRODataReader(JRODataIO): | |||
|
663 | 662 | self.filenameList = filenameList |
|
664 | 663 | self.datetimeList = datetimeList |
|
665 | 664 | |
|
665 | ||
|
666 | 666 | return pathList, filenameList |
|
667 | 667 | |
|
668 |
def __searchFilesOnLine(self, path, expLabel |
|
|
668 | def __searchFilesOnLine(self, path, expLabel="", ext=None, walk=True, set=None, startDate=None, startTime=None): | |
|
669 | 669 | |
|
670 | 670 | """ |
|
671 | Busca el ultimo archivo de la ultima carpeta (determinada o no por startDateTime) y | |
|
672 | devuelve el archivo encontrado ademas de otros datos. | |
|
673 | ||
|
674 | Input: | |
|
675 | path : carpeta donde estan contenidos los files que contiene data | |
|
676 | ||
|
677 | expLabel : Nombre del subexperimento (subfolder) | |
|
678 | ||
|
679 | ext : extension de los files | |
|
680 | ||
|
681 | walk : Si es habilitado no realiza busquedas dentro de los subdirectorios (doypath) | |
|
682 | ||
|
683 | Return: | |
|
684 | directory : eL directorio donde esta el file encontrado | |
|
685 | filename : el ultimo file de una determinada carpeta | |
|
686 | year : el anho | |
|
687 | doy : el numero de dia del anho | |
|
688 | set : el set del archivo | |
|
671 | Busca el ultimo archivo de la ultima carpeta (determinada o no por startDateTime) y | |
|
672 | devuelve el archivo encontrado ademas de otros datos. | |
|
689 | 673 | |
|
674 | Input: | |
|
675 | path : carpeta donde estan contenidos los files que contiene data | |
|
676 | ||
|
677 | expLabel : Nombre del subexperimento (subfolder) | |
|
678 | ||
|
679 | ext : extension de los files | |
|
680 | ||
|
681 | walk : Si es habilitado no realiza busquedas dentro de los subdirectorios (doypath) | |
|
682 | ||
|
683 | Return: | |
|
684 | directory : eL directorio donde esta el file encontrado | |
|
685 | filename : el ultimo file de una determinada carpeta | |
|
686 | year : el anho | |
|
687 | doy : el numero de dia del anho | |
|
688 | set : el set del archivo | |
|
689 | ||
|
690 | 690 | |
|
691 | 691 | """ |
|
692 | pathList = None | |
|
693 | filenameList = None | |
|
692 | 694 | if not os.path.isdir(path): |
|
693 | 695 | return None, None, None, None, None, None |
|
694 | 696 | |
@@ -735,7 +737,7 class JRODataReader(JRODataIO): | |||
|
735 | 737 | year = int( filename[1:5] ) |
|
736 | 738 | doy = int( filename[5:8] ) |
|
737 | 739 | set = int( filename[8:11] ) |
|
738 | ||
|
740 | ||
|
739 | 741 | return fullpath, foldercounter, filename, year, doy, set |
|
740 | 742 | |
|
741 | 743 | def __setNextFileOffline(self): |
@@ -746,7 +748,7 class JRODataReader(JRODataIO): | |||
|
746 | 748 | idFile += 1 |
|
747 | 749 | if not(idFile < len(self.filenameList)): |
|
748 | 750 | self.flagNoMoreFiles = 1 |
|
749 |
|
|
|
751 | # print "[Reading] No more Files" | |
|
750 | 752 | return 0 |
|
751 | 753 | |
|
752 | 754 | filename = self.filenameList[idFile] |
@@ -764,31 +766,32 class JRODataReader(JRODataIO): | |||
|
764 | 766 | self.fileSize = fileSize |
|
765 | 767 | self.fp = fp |
|
766 | 768 | |
|
767 |
# |
|
|
769 | #print "[Reading] Setting the file: %s"%self.filename | |
|
768 | 770 | |
|
769 | 771 | return 1 |
|
770 | 772 | |
|
771 | 773 | def __setNextFileOnline(self): |
|
772 | 774 | """ |
|
773 | Busca el siguiente file que tenga suficiente data para ser leida, dentro de un folder especifico, si | |
|
774 | no encuentra un file valido espera un tiempo determinado y luego busca en los posibles n files | |
|
775 | siguientes. | |
|
775 | Busca el siguiente file que tenga suficiente data para ser leida, dentro de un folder especifico, si | |
|
776 | no encuentra un file valido espera un tiempo determinado y luego busca en los posibles n files | |
|
777 | siguientes. | |
|
778 | ||
|
779 | Affected: | |
|
780 | self.flagIsNewFile | |
|
781 | self.filename | |
|
782 | self.fileSize | |
|
783 | self.fp | |
|
784 | self.set | |
|
785 | self.flagNoMoreFiles | |
|
786 | ||
|
787 | Return: | |
|
788 | 0 : si luego de una busqueda del siguiente file valido este no pudo ser encontrado | |
|
789 | 1 : si el file fue abierto con exito y esta listo a ser leido | |
|
776 | 790 | |
|
777 |
|
|
|
778 | self.flagIsNewFile | |
|
779 | self.filename | |
|
780 | self.fileSize | |
|
781 | self.fp | |
|
782 | self.set | |
|
783 | self.flagNoMoreFiles | |
|
784 | ||
|
785 | Return: | |
|
786 | 0 : si luego de una busqueda del siguiente file valido este no pudo ser encontrado | |
|
787 | 1 : si el file fue abierto con exito y esta listo a ser leido | |
|
791 | Excepciones: | |
|
792 | Si un determinado file no puede ser abierto | |
|
793 | """ | |
|
788 | 794 | |
|
789 | Excepciones: | |
|
790 | Si un determinado file no puede ser abierto | |
|
791 | """ | |
|
792 | 795 | nFiles = 0 |
|
793 | 796 | fileOk_flag = False |
|
794 | 797 | firstTime_flag = True |
@@ -861,13 +864,34 class JRODataReader(JRODataIO): | |||
|
861 | 864 | def setNextFile(self): |
|
862 | 865 | if self.fp != None: |
|
863 | 866 | self.fp.close() |
|
864 | ||
|
865 | 867 | if self.online: |
|
866 | 868 | newFile = self.__setNextFileOnline() |
|
867 | 869 | else: |
|
868 | 870 | newFile = self.__setNextFileOffline() |
|
869 | ||
|
870 | 871 | if not(newFile): |
|
872 | if self.onlineWithDate is True: | |
|
873 | self.onlineWithDate=False | |
|
874 | self.online = True | |
|
875 | self.firstTime = False | |
|
876 | self.setup( | |
|
877 | path=self.path, | |
|
878 | startDate=self.startDate, | |
|
879 | endDate=self.endDate, | |
|
880 | startTime=self.startTime , | |
|
881 | endTime=self.endTime, | |
|
882 | set=self.set, | |
|
883 | expLabel=self.expLabel, | |
|
884 | ext=self.ext, | |
|
885 | online=self.online, | |
|
886 | delay=self.delay, | |
|
887 | walk=self.walk, | |
|
888 | getblock=self.getblock, | |
|
889 | nTxs=self.nTxs, | |
|
890 | realtime=self.realtime, | |
|
891 | blocksize=self.blocksize, | |
|
892 | blocktime=self.blocktime | |
|
893 | ) | |
|
894 | return 1 | |
|
871 | 895 | print '[Reading] No more files to read' |
|
872 | 896 | return 0 |
|
873 | 897 | |
@@ -1021,12 +1045,9 class JRODataReader(JRODataIO): | |||
|
1021 | 1045 | while True: |
|
1022 | 1046 | if not(self.__setNewBlock()): |
|
1023 | 1047 | return 0 |
|
1024 | ||
|
1025 | 1048 | if not(self.readBlock()): |
|
1026 | 1049 | return 0 |
|
1027 | ||
|
1028 | 1050 | self.getBasicHeader() |
|
1029 | ||
|
1030 | 1051 | if not isTimeInRange(self.dataOut.datatime.time(), self.startTime, self.endTime): |
|
1031 | 1052 | |
|
1032 | 1053 | print "[Reading] Block No. %d/%d -> %s [Skipping]" %(self.nReadBlocks, |
@@ -1035,7 +1056,6 class JRODataReader(JRODataIO): | |||
|
1035 | 1056 | continue |
|
1036 | 1057 | |
|
1037 | 1058 | break |
|
1038 | ||
|
1039 | 1059 | print "[Reading] Block No. %d/%d -> %s" %(self.nReadBlocks, |
|
1040 | 1060 | self.processingHeaderObj.dataBlocksPerFile, |
|
1041 | 1061 | self.dataOut.datatime.ctime()) |
@@ -1250,26 +1270,60 class JRODataReader(JRODataIO): | |||
|
1250 | 1270 | |
|
1251 | 1271 | if path == None: |
|
1252 | 1272 | raise ValueError, "[Reading] The path is not valid" |
|
1273 | ||
|
1253 | 1274 | |
|
1254 | 1275 | if ext == None: |
|
1255 | 1276 | ext = self.ext |
|
1277 | ||
|
1278 | self.path = path | |
|
1279 | self.startDate = startDate | |
|
1280 | self.endDate = endDate | |
|
1281 | self.startTime = startTime | |
|
1282 | self.endTime = endTime | |
|
1283 | self.set = set | |
|
1284 | self.expLabel = expLabel | |
|
1285 | self.ext = ext | |
|
1286 | self.online = online | |
|
1287 | self.delay = delay | |
|
1288 | self.walk = walk | |
|
1289 | self.getblock = getblock | |
|
1290 | self.nTxs = nTxs | |
|
1291 | self.realtime = realtime | |
|
1292 | self.blocksize = blocksize | |
|
1293 | self.blocktime = blocktime | |
|
1294 | ||
|
1295 | ||
|
1296 | if self.firstTime is True: | |
|
1297 | pathList, filenameList = self.__searchFilesOffLine(path, startDate=startDate, endDate=endDate, | |
|
1298 | startTime=startTime, endTime=endTime, | |
|
1299 | set=set, expLabel=expLabel, ext=ext, | |
|
1300 | walk=walk) | |
|
1301 | filenameList = filenameList[:-1] | |
|
1302 | ||
|
1303 | if pathList is not None and filenameList is not None and online: | |
|
1304 | self.onlineWithDate = True | |
|
1305 | online = False | |
|
1306 | self.fileIndex = -1 | |
|
1307 | self.pathList = pathList | |
|
1308 | self.filenameList = filenameList | |
|
1309 | file_name = os.path.basename(filenameList[-1]) | |
|
1310 | basename, ext = os.path.splitext(file_name) | |
|
1311 | last_set = int(basename[-3:]) | |
|
1256 | 1312 | |
|
1257 | 1313 | if online: |
|
1258 | 1314 | print "[Reading] Searching files in online mode..." |
|
1259 | 1315 | |
|
1260 |
for nTries in range( |
|
|
1316 | for nTries in range(self.nTries): | |
|
1261 | 1317 | fullpath, foldercounter, file, year, doy, set = self.__searchFilesOnLine(path=path, |
|
1262 | 1318 | expLabel=expLabel, |
|
1263 | 1319 | ext=ext, |
|
1264 | 1320 | walk=walk, |
|
1265 | 1321 | startDate=startDate, |
|
1266 |
|
|
|
1267 | startTime=startTime, endTime=endTime, | |
|
1322 | startTime=startTime, | |
|
1268 | 1323 | set=set) |
|
1269 | ||
|
1324 | ||
|
1270 | 1325 | if fullpath: |
|
1271 | 1326 | break |
|
1272 | ||
|
1273 | 1327 | print '[Reading] Waiting %0.2f sec for an valid file in %s: try %02d ...' % (self.delay, path, nTries+1) |
|
1274 | 1328 | sleep( self.delay ) |
|
1275 | 1329 | |
@@ -1283,7 +1337,7 class JRODataReader(JRODataIO): | |||
|
1283 | 1337 | self.path = path |
|
1284 | 1338 | self.foldercounter = foldercounter |
|
1285 | 1339 | last_set = None |
|
1286 | ||
|
1340 | ||
|
1287 | 1341 | else: |
|
1288 | 1342 | print "[Reading] Searching files in offline mode ..." |
|
1289 | 1343 | pathList, filenameList = self.__searchFilesOffLine(path, startDate=startDate, endDate=endDate, |
@@ -1309,7 +1363,8 class JRODataReader(JRODataIO): | |||
|
1309 | 1363 | file_name = os.path.basename(filenameList[-1]) |
|
1310 | 1364 | basename, ext = os.path.splitext(file_name) |
|
1311 | 1365 | last_set = int(basename[-3:]) |
|
1312 | ||
|
1366 | ||
|
1367 | ||
|
1313 | 1368 | self.online = online |
|
1314 | 1369 | self.realtime = realtime |
|
1315 | 1370 | self.delay = delay |
@@ -1319,6 +1374,7 class JRODataReader(JRODataIO): | |||
|
1319 | 1374 | self.nTxs = nTxs |
|
1320 | 1375 | self.startTime = startTime |
|
1321 | 1376 | self.endTime = endTime |
|
1377 | ||
|
1322 | 1378 | |
|
1323 | 1379 | #Added----------------- |
|
1324 | 1380 | self.selBlocksize = blocksize |
@@ -1339,7 +1395,7 class JRODataReader(JRODataIO): | |||
|
1339 | 1395 | return |
|
1340 | 1396 | |
|
1341 | 1397 | # self.getBasicHeader() |
|
1342 | ||
|
1398 | ||
|
1343 | 1399 | if last_set != None: |
|
1344 | 1400 | self.dataOut.last_block = last_set * self.processingHeaderObj.dataBlocksPerFile + self.basicHeaderObj.dataBlock |
|
1345 | 1401 | return |
@@ -1360,7 +1416,7 class JRODataReader(JRODataIO): | |||
|
1360 | 1416 | |
|
1361 | 1417 | self.dataOut.ippSeconds = self.radarControllerHeaderObj.ippSeconds/self.nTxs |
|
1362 | 1418 | |
|
1363 | # self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock*self.nTxs | |
|
1419 | # self.dataOut.nProfiles = self.processingHeaderObj.profilesPerBlock*self.nTxs | |
|
1364 | 1420 | |
|
1365 | 1421 | |
|
1366 | 1422 | def getFirstHeader(self): |
@@ -1415,7 +1471,7 class JRODataReader(JRODataIO): | |||
|
1415 | 1471 | |
|
1416 | 1472 | if not(self.isConfig): |
|
1417 | 1473 | |
|
1418 | # self.dataOut = dataOut | |
|
1474 | # self.dataOut = dataOut | |
|
1419 | 1475 | self.setup(**kwargs) |
|
1420 | 1476 | self.isConfig = True |
|
1421 | 1477 | |
@@ -1538,7 +1594,7 class JRODataWriter(JRODataIO): | |||
|
1538 | 1594 | None |
|
1539 | 1595 | """ |
|
1540 | 1596 | |
|
1541 | # CALCULAR PARAMETROS | |
|
1597 | # CALCULAR PARAMETROS | |
|
1542 | 1598 | |
|
1543 | 1599 | sizeLongHeader = self.systemHeaderObj.size + self.radarControllerHeaderObj.size + self.processingHeaderObj.size |
|
1544 | 1600 | self.basicHeaderObj.size = self.basicHeaderSize + sizeLongHeader |
@@ -177,13 +177,13 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
177 | 177 | |
|
178 | 178 | def getBlockDimension(self): |
|
179 | 179 | """ |
|
180 | Obtiene la cantidad de puntos a leer por cada bloque de datos | |
|
181 | ||
|
182 | Affected: | |
|
183 | self.blocksize | |
|
180 | Obtiene la cantidad de puntos a leer por cada bloque de datos | |
|
181 | ||
|
182 | Affected: | |
|
183 | self.blocksize | |
|
184 | 184 | |
|
185 | Return: | |
|
186 | None | |
|
185 | Return: | |
|
186 | None | |
|
187 | 187 | """ |
|
188 | 188 | pts2read = self.processingHeaderObj.profilesPerBlock * self.processingHeaderObj.nHeights * self.systemHeaderObj.nChannels |
|
189 | 189 | self.blocksize = pts2read |
@@ -191,26 +191,26 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
191 | 191 | |
|
192 | 192 | def readBlock(self): |
|
193 | 193 | """ |
|
194 | readBlock lee el bloque de datos desde la posicion actual del puntero del archivo | |
|
195 | (self.fp) y actualiza todos los parametros relacionados al bloque de datos | |
|
196 | (metadata + data). La data leida es almacenada en el buffer y el contador del buffer | |
|
197 | es seteado a 0 | |
|
198 | ||
|
199 | Inputs: | |
|
200 | None | |
|
194 | readBlock lee el bloque de datos desde la posicion actual del puntero del archivo | |
|
195 | (self.fp) y actualiza todos los parametros relacionados al bloque de datos | |
|
196 | (metadata + data). La data leida es almacenada en el buffer y el contador del buffer | |
|
197 | es seteado a 0 | |
|
201 | 198 | |
|
202 | Return: | |
|
203 | None | |
|
204 | ||
|
205 |
|
|
|
206 | self.profileIndex | |
|
207 | self.datablock | |
|
208 | self.flagIsNewFile | |
|
209 | self.flagIsNewBlock | |
|
210 | self.nTotalBlocks | |
|
199 | Inputs: | |
|
200 | None | |
|
201 | ||
|
202 | Return: | |
|
203 | None | |
|
211 | 204 | |
|
212 | Exceptions: | |
|
213 | Si un bloque leido no es un bloque valido | |
|
205 | Affected: | |
|
206 | self.profileIndex | |
|
207 | self.datablock | |
|
208 | self.flagIsNewFile | |
|
209 | self.flagIsNewBlock | |
|
210 | self.nTotalBlocks | |
|
211 | ||
|
212 | Exceptions: | |
|
213 | Si un bloque leido no es un bloque valido | |
|
214 | 214 | """ |
|
215 | 215 | current_pointer_location = self.fp.tell() |
|
216 | 216 | junk = numpy.fromfile( self.fp, self.dtype, self.blocksize ) |
@@ -303,39 +303,39 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
303 | 303 | |
|
304 | 304 | def getData(self): |
|
305 | 305 | """ |
|
306 | getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut | |
|
307 | del tipo "Voltage" con todos los parametros asociados a este (metadata). cuando no hay datos | |
|
308 | en el buffer de lectura es necesario hacer una nueva lectura de los bloques de datos usando | |
|
309 | "readNextBlock" | |
|
310 | ||
|
311 | Ademas incrementa el contador del buffer "self.profileIndex" en 1. | |
|
312 | ||
|
313 | Return: | |
|
314 | ||
|
315 | Si el flag self.getByBlock ha sido seteado el bloque completo es copiado a self.dataOut y el self.profileIndex | |
|
316 | es igual al total de perfiles leidos desde el archivo. | |
|
317 | ||
|
318 | Si self.getByBlock == False: | |
|
306 | getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut | |
|
307 | del tipo "Voltage" con todos los parametros asociados a este (metadata). cuando no hay datos | |
|
308 | en el buffer de lectura es necesario hacer una nueva lectura de los bloques de datos usando | |
|
309 | "readNextBlock" | |
|
319 | 310 | |
|
320 | self.dataOut.data = buffer[:, thisProfile, :] | |
|
321 | ||
|
322 | shape = [nChannels, nHeis] | |
|
323 | ||
|
324 | Si self.getByBlock == True: | |
|
311 | Ademas incrementa el contador del buffer "self.profileIndex" en 1. | |
|
325 | 312 | |
|
326 | self.dataOut.data = buffer[:, :, :] | |
|
327 | ||
|
328 | shape = [nChannels, nProfiles, nHeis] | |
|
313 | Return: | |
|
329 | 314 | |
|
330 | Variables afectadas: | |
|
331 | self.dataOut | |
|
332 | self.profileIndex | |
|
315 | Si el flag self.getByBlock ha sido seteado el bloque completo es copiado a self.dataOut y el self.profileIndex | |
|
316 | es igual al total de perfiles leidos desde el archivo. | |
|
333 | 317 | |
|
334 | Affected: | |
|
335 |
|
|
|
336 | self.profileIndex | |
|
337 | self.flagDiscontinuousBlock | |
|
338 | self.flagIsNewBlock | |
|
318 | Si self.getByBlock == False: | |
|
319 | ||
|
320 | self.dataOut.data = buffer[:, thisProfile, :] | |
|
321 | ||
|
322 | shape = [nChannels, nHeis] | |
|
323 | ||
|
324 | Si self.getByBlock == True: | |
|
325 | ||
|
326 | self.dataOut.data = buffer[:, :, :] | |
|
327 | ||
|
328 | shape = [nChannels, nProfiles, nHeis] | |
|
329 | ||
|
330 | Variables afectadas: | |
|
331 | self.dataOut | |
|
332 | self.profileIndex | |
|
333 | ||
|
334 | Affected: | |
|
335 | self.dataOut | |
|
336 | self.profileIndex | |
|
337 | self.flagDiscontinuousBlock | |
|
338 | self.flagIsNewBlock | |
|
339 | 339 | """ |
|
340 | 340 | |
|
341 | 341 | if self.flagNoMoreFiles: |
@@ -362,10 +362,10 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
362 | 362 | if not self.getByBlock: |
|
363 | 363 | |
|
364 | 364 | """ |
|
365 | Return profile by profile | |
|
366 | ||
|
367 | If nTxs > 1 then one profile is divided by nTxs and number of total | |
|
368 | blocks is increased by nTxs (nProfiles *= nTxs) | |
|
365 | Return profile by profile | |
|
366 | ||
|
367 | If nTxs > 1 then one profile is divided by nTxs and number of total | |
|
368 | blocks is increased by nTxs (nProfiles *= nTxs) | |
|
369 | 369 | """ |
|
370 | 370 | self.dataOut.flagDataAsBlock = False |
|
371 | 371 | self.dataOut.data = self.datablock[:,self.profileIndex,:] |
@@ -373,26 +373,26 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
373 | 373 | |
|
374 | 374 | self.profileIndex += 1 |
|
375 | 375 | |
|
376 | # elif self.selBlocksize==None or self.selBlocksize==self.dataOut.nProfiles: | |
|
377 | # """ | |
|
378 | # Return all block | |
|
379 | # """ | |
|
380 | # self.dataOut.flagDataAsBlock = True | |
|
381 | # self.dataOut.data = self.datablock | |
|
382 | # self.dataOut.profileIndex = self.dataOut.nProfiles - 1 | |
|
383 | # | |
|
384 | # self.profileIndex = self.dataOut.nProfiles | |
|
376 | # elif self.selBlocksize==None or self.selBlocksize==self.dataOut.nProfiles: | |
|
377 | # """ | |
|
378 | # Return all block | |
|
379 | # """ | |
|
380 | # self.dataOut.flagDataAsBlock = True | |
|
381 | # self.dataOut.data = self.datablock | |
|
382 | # self.dataOut.profileIndex = self.dataOut.nProfiles - 1 | |
|
383 | # | |
|
384 | # self.profileIndex = self.dataOut.nProfiles | |
|
385 | 385 | |
|
386 | 386 | else: |
|
387 | 387 | """ |
|
388 | Return a block | |
|
388 | Return a block | |
|
389 | 389 | """ |
|
390 | 390 | if self.selBlocksize == None: self.selBlocksize = self.dataOut.nProfiles |
|
391 | 391 | if self.selBlocktime != None: |
|
392 | 392 | if self.dataOut.nCohInt is not None: |
|
393 | 393 | nCohInt = self.dataOut.nCohInt |
|
394 | 394 | else: |
|
395 |
nCohInt = 1 |
|
|
395 | nCohInt = 1 | |
|
396 | 396 | self.selBlocksize = int(self.dataOut.nProfiles*round(self.selBlocktime/(nCohInt*self.dataOut.ippSeconds*self.dataOut.nProfiles))) |
|
397 | 397 | |
|
398 | 398 | self.dataOut.data = self.datablock[:,self.profileIndex:self.profileIndex+self.selBlocksize,:] |
@@ -429,7 +429,7 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
429 | 429 | self.getBasicHeader() |
|
430 | 430 | |
|
431 | 431 | self.dataOut.realtime = self.online |
|
432 | ||
|
432 | ||
|
433 | 433 | return self.dataOut.data |
|
434 | 434 | |
|
435 | 435 | class VoltageWriter(JRODataWriter, Operation): |
@@ -168,13 +168,13 class Remote(Thread): | |||
|
168 | 168 | return 0 |
|
169 | 169 | |
|
170 | 170 | self.mutex.acquire() |
|
171 | # init = time.time() | |
|
172 | # | |
|
173 | # while(self.bussy): | |
|
174 | # sleep(0.1) | |
|
175 | # if time.time() - init > 2*self.period: | |
|
176 | # return 0 | |
|
177 | ||
|
171 | # init = time.time() | |
|
172 | # | |
|
173 | # while(self.bussy): | |
|
174 | # sleep(0.1) | |
|
175 | # if time.time() - init > 2*self.period: | |
|
176 | # return 0 | |
|
177 | ||
|
178 | 178 | self.fileList = fileList |
|
179 | 179 | self.mutex.release() |
|
180 | 180 | return 1 |
@@ -198,7 +198,7 class Remote(Thread): | |||
|
198 | 198 | if self.stopFlag: |
|
199 | 199 | break |
|
200 | 200 | |
|
201 | # self.bussy = True | |
|
201 | # self.bussy = True | |
|
202 | 202 | self.mutex.acquire() |
|
203 | 203 | |
|
204 | 204 | print "[Remote Server] Opening %s" %self.__server |
@@ -623,6 +623,7 class SendToServer(ProcessingUnit): | |||
|
623 | 623 | filenameList = glob.glob1(thisFolder, '*%s' %self.ext) |
|
624 | 624 | |
|
625 | 625 | if len(filenameList) < 1: |
|
626 | ||
|
626 | 627 | continue |
|
627 | 628 | |
|
628 | 629 | for thisFile in filenameList: |
@@ -18,7 +18,7 controllerObj.setup(id = '002', name='script02', description="JASMET Meteor Dete | |||
|
18 | 18 | # path = '/mnt/jars/2016_08/NOCHE' |
|
19 | 19 | # path = '/media/joscanoa/DATA_JASMET/JASMET/2016_08/DIA' |
|
20 | 20 | # path = '/media/joscanoa/DATA_JASMET/JASMET/2016_08/NOCHE' |
|
21 | path = '/media/joscanoa/DATA_JASMET/JASMET/2016_08/DIA' | |
|
21 | path = '/home/nanosat/data/jasmet' | |
|
22 | 22 | |
|
23 | 23 | #Path para los graficos |
|
24 | 24 | pathfig = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/graphics') |
@@ -27,8 +27,8 pathfig = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/graphics') | |||
|
27 | 27 | pathfile = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/meteor') |
|
28 | 28 | |
|
29 | 29 | #Fechas para busqueda de archivos |
|
30 |
startDate = '201 |
|
|
31 |
endDate = '201 |
|
|
30 | startDate = '2010/08/29' | |
|
31 | endDate = '2017/09/11' | |
|
32 | 32 | #Horas para busqueda de archivos |
|
33 | 33 | startTime = '00:00:00' |
|
34 | 34 | endTime = '23:59:59' |
@@ -60,38 +60,40 opObj00.addParameter(name='channelList', value='0,1,2,3,4', format='intlist') | |||
|
60 | 60 | opObj01 = procUnitConfObj0.addOperation(name='setRadarFrequency') |
|
61 | 61 | opObj01.addParameter(name='frequency', value='30.e6', format='float') |
|
62 | 62 | |
|
63 | opObj01 = procUnitConfObj0.addOperation(name='interpolateHeights') | |
|
64 | opObj01.addParameter(name='topLim', value='73', format='int') | |
|
65 | opObj01.addParameter(name='botLim', value='71', format='int') | |
|
63 | # opObj01 = procUnitConfObj0.addOperation(name='interpolateHeights') | |
|
64 | # opObj01.addParameter(name='topLim', value='73', format='int') | |
|
65 | # opObj01.addParameter(name='botLim', value='71', format='int') | |
|
66 | 66 | |
|
67 | 67 | opObj02 = procUnitConfObj0.addOperation(name='Decoder', optype='other') |
|
68 | 68 | |
|
69 | 69 | opObj03 = procUnitConfObj0.addOperation(name='CohInt', optype='other') |
|
70 | 70 | opObj03.addParameter(name='n', value='2', format='int') |
|
71 | 71 | |
|
72 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='SpectraProc', inputId=procUnitConfObj0.getId()) | |
|
73 | opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='other') | |
|
74 | opObj11.addParameter(name='id', value='237', format='int') | |
|
75 | opObj11.addParameter(name='xmin', value='9.0', format='float') | |
|
76 | opObj11.addParameter(name='xmax', value='16.0', format='float') | |
|
77 | opObj11.addParameter(name='zmin', value='15.0', format='float') | |
|
78 | opObj11.addParameter(name='zmax', value='50.0', format='float') | |
|
79 | ||
|
72 | 80 | #--------------------------- Parameters Processing Unit ------------------------------------ |
|
73 | 81 | |
|
74 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObj0.getId()) | |
|
75 | # | |
|
76 | opObj10 = procUnitConfObj1.addOperation(name='SMDetection', optype='other') | |
|
77 | opObj10.addParameter(name='azimuth', value='45', format='float') | |
|
78 | opObj10.addParameter(name='hmin', value='60', format='float') | |
|
79 | opObj10.addParameter(name='hmax', value='120', format='float') | |
|
80 | ||
|
81 | opObj12 = procUnitConfObj1.addOperation(name='ParamWriter', optype='other') | |
|
82 | opObj12.addParameter(name='path', value=pathfile) | |
|
83 | opObj12.addParameter(name='blocksPerFile', value='1000', format='int') | |
|
84 | opObj12.addParameter(name='metadataList',value='type,heightList,paramInterval,timeZone',format='list') | |
|
85 | opObj12.addParameter(name='dataList',value='data_param,utctime',format='list') | |
|
86 | opObj12.addParameter(name='mode',value='2',format='int') | |
|
82 | # procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObj0.getId()) | |
|
83 | # # | |
|
84 | # opObj10 = procUnitConfObj1.addOperation(name='SMDetection', optype='other') | |
|
85 | # opObj10.addParameter(name='azimuth', value='45', format='float') | |
|
86 | # opObj10.addParameter(name='hmin', value='60', format='float') | |
|
87 | # opObj10.addParameter(name='hmax', value='120', format='float') | |
|
88 | ||
|
89 | # opObj12 = procUnitConfObj1.addOperation(name='ParamWriter', optype='other') | |
|
90 | # opObj12.addParameter(name='path', value=pathfile) | |
|
91 | # opObj12.addParameter(name='blocksPerFile', value='1000', format='int') | |
|
92 | # opObj12.addParameter(name='metadataList',value='type,heightList,paramInterval,timeZone',format='list') | |
|
93 | # opObj12.addParameter(name='dataList',value='data_param,utctime',format='list') | |
|
94 | # opObj12.addParameter(name='mode',value='2',format='int') | |
|
87 | 95 | |
|
88 | 96 | #-------------------------------------------------------------------------------------------------- |
|
89 | ||
|
90 | print "Escribiendo el archivo XML" | |
|
91 | controllerObj.writeXml("JASMET02.xml") | |
|
92 | print "Leyendo el archivo XML" | |
|
93 | controllerObj.readXml("JASMET02.xml") | |
|
94 | ||
|
95 | 97 | controllerObj.createObjects() |
|
96 | 98 | controllerObj.connectObjects() |
|
97 | 99 | controllerObj.run() No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now