@@ -665,27 +665,27 class JRODataReader(JRODataIO): | |||||
665 |
|
665 | |||
666 | return pathList, filenameList |
|
666 | return pathList, filenameList | |
667 |
|
667 | |||
668 | def __searchFilesOnLine(self, path, expLabel = "", ext = None, walk=True, set=None): |
|
668 | def __searchFilesOnLine(self, path, expLabel = "", ext = None, walk=True, set=None, startDate=None, endDate=None): | |
669 |
|
669 | |||
670 | """ |
|
670 | """ | |
671 | Busca el ultimo archivo de la ultima carpeta (determinada o no por startDateTime) y |
|
671 | Busca el ultimo archivo de la ultima carpeta (determinada o no por startDateTime) y | |
672 | devuelve el archivo encontrado ademas de otros datos. |
|
672 | devuelve el archivo encontrado ademas de otros datos. | |
673 |
|
673 | |||
674 | Input: |
|
674 | Input: | |
675 | path : carpeta donde estan contenidos los files que contiene data |
|
675 | path : carpeta donde estan contenidos los files que contiene data | |
676 |
|
676 | |||
677 | expLabel : Nombre del subexperimento (subfolder) |
|
677 | expLabel : Nombre del subexperimento (subfolder) | |
678 |
|
678 | |||
679 |
ext |
|
679 | ext : extension de los files | |
680 |
|
680 | |||
681 | walk : Si es habilitado no realiza busquedas dentro de los ubdirectorios (doypath) |
|
681 | walk : Si es habilitado no realiza busquedas dentro de los subdirectorios (doypath) | |
682 |
|
682 | |||
683 | Return: |
|
683 | Return: | |
684 | directory : eL directorio donde esta el file encontrado |
|
684 | directory : eL directorio donde esta el file encontrado | |
685 | filename : el ultimo file de una determinada carpeta |
|
685 | filename : el ultimo file de una determinada carpeta | |
686 | year : el anho |
|
686 | year : el anho | |
687 | doy : el numero de dia del anho |
|
687 | doy : el numero de dia del anho | |
688 | set : el set del archivo |
|
688 | set : el set del archivo | |
689 |
|
689 | |||
690 |
|
690 | |||
691 | """ |
|
691 | """ | |
@@ -698,7 +698,7 class JRODataReader(JRODataIO): | |||||
698 | fullpath = path |
|
698 | fullpath = path | |
699 | foldercounter = 0 |
|
699 | foldercounter = 0 | |
700 | else: |
|
700 | else: | |
701 | #Filtra solo los directorios |
|
701 | # Filtra solo los directorios | |
702 | for thisPath in os.listdir(path): |
|
702 | for thisPath in os.listdir(path): | |
703 | if not os.path.isdir(os.path.join(path,thisPath)): |
|
703 | if not os.path.isdir(os.path.join(path,thisPath)): | |
704 | continue |
|
704 | continue | |
@@ -1258,7 +1258,14 class JRODataReader(JRODataIO): | |||||
1258 | print "[Reading] Searching files in online mode..." |
|
1258 | print "[Reading] Searching files in online mode..." | |
1259 |
|
1259 | |||
1260 | for nTries in range( self.nTries ): |
|
1260 | for nTries in range( self.nTries ): | |
1261 |
fullpath, foldercounter, file, year, doy, set = self.__searchFilesOnLine(path=path, |
|
1261 | fullpath, foldercounter, file, year, doy, set = self.__searchFilesOnLine(path=path, | |
|
1262 | expLabel=expLabel, | |||
|
1263 | ext=ext, | |||
|
1264 | walk=walk, | |||
|
1265 | startDate=startDate, | |||
|
1266 | endDate=endDate, | |||
|
1267 | startTime=startTime, endTime=endTime, | |||
|
1268 | set=set) | |||
1262 |
|
1269 | |||
1263 | if fullpath: |
|
1270 | if fullpath: | |
1264 | break |
|
1271 | break | |
@@ -1285,11 +1292,11 class JRODataReader(JRODataIO): | |||||
1285 | walk=walk) |
|
1292 | walk=walk) | |
1286 |
|
1293 | |||
1287 | if not(pathList): |
|
1294 | if not(pathList): | |
1288 | # print "[Reading] No *%s files in %s (%s - %s)"%(ext, path, |
|
1295 | # print "[Reading] No *%s files in %s (%s - %s)"%(ext, path, | |
1289 | # datetime.datetime.combine(startDate,startTime).ctime(), |
|
1296 | # datetime.datetime.combine(startDate,startTime).ctime(), | |
1290 | # datetime.datetime.combine(endDate,endTime).ctime()) |
|
1297 | # datetime.datetime.combine(endDate,endTime).ctime()) | |
1291 |
|
1298 | |||
1292 | # sys.exit(-1) |
|
1299 | # sys.exit(-1) | |
1293 |
|
1300 | |||
1294 | self.fileIndex = -1 |
|
1301 | self.fileIndex = -1 | |
1295 | self.pathList = [] |
|
1302 | self.pathList = [] |
General Comments 0
You need to be logged in to leave comments.
Login now