@@ -34,6 +34,8 def MPProject(project, n=cpu_count()): | |||
|
34 | 34 | op = rconf.getOperationObj('run') |
|
35 | 35 | dt1 = op.getParameterValue('startDate') |
|
36 | 36 | dt2 = op.getParameterValue('endDate') |
|
37 | tm1 = op.getParameterValue('startTime') | |
|
38 | tm2 = op.getParameterValue('endTime') | |
|
37 | 39 | days = (dt2 - dt1).days |
|
38 | 40 | |
|
39 | 41 | for day in range(days + 1): |
@@ -46,6 +48,8 def MPProject(project, n=cpu_count()): | |||
|
46 | 48 | paths, files = reader.searchFilesOffLine(path=rconf.path, |
|
47 | 49 | startDate=dt, |
|
48 | 50 | endDate=dt, |
|
51 | startTime=tm1, | |
|
52 | endTime=tm2, | |
|
49 | 53 | ext=DTYPES[rconf.datatype]) |
|
50 | 54 | nFiles = len(files) |
|
51 | 55 | if nFiles == 0: |
@@ -1270,7 +1274,7 class Project(Process): | |||
|
1270 | 1274 | def run(self): |
|
1271 | 1275 | |
|
1272 | 1276 | log.success('Starting {}'.format(self.name)) |
|
1273 | ||
|
1277 | self.start_time = time.time() | |
|
1274 | 1278 | self.createObjects() |
|
1275 | 1279 | self.connectObjects() |
|
1276 | 1280 | |
@@ -1314,4 +1318,6 class Project(Process): | |||
|
1314 | 1318 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1315 | 1319 | procUnitConfObj.close() |
|
1316 | 1320 | |
|
1317 |
log.success('{} finished'.format( |
|
|
1321 | log.success('{} finished (time: {}s)'.format( | |
|
1322 | self.name, | |
|
1323 | time.time()-self.start_time)) |
@@ -494,7 +494,7 class RadarControllerHeader(Header): | |||
|
494 | 494 | code1 = (self.code + 1.0)/2. |
|
495 | 495 | |
|
496 | 496 | for ic in range(self.nCode): |
|
497 | tempx = numpy.zeros(numpy.ceil(self.nBaud/32.)) | |
|
497 | tempx = numpy.zeros(int(numpy.ceil(self.nBaud/32.))) | |
|
498 | 498 | start = 0 |
|
499 | 499 | end = 32 |
|
500 | 500 | for i in range(len(tempx)): |
@@ -22,6 +22,7 except: | |||
|
22 | 22 | |
|
23 | 23 | from schainpy.model.data.jroheaderIO import PROCFLAG, BasicHeader, SystemHeader, RadarControllerHeader, ProcessingHeader |
|
24 | 24 | from schainpy.model.data.jroheaderIO import get_dtype_index, get_numpy_dtype, get_procflag_dtype, get_dtype_width |
|
25 | from schainpy.utils import log | |
|
25 | 26 | |
|
26 | 27 | LOCALTIME = True |
|
27 | 28 | |
@@ -655,20 +656,7 class JRODataReader(JRODataIO): | |||
|
655 | 656 | fileList = glob.glob1(thisPath, "*%s" % ext) |
|
656 | 657 | fileList.sort() |
|
657 | 658 | |
|
658 |
|
|
|
659 | ||
|
660 | if cursor is not None and skip is not None: | |
|
661 | ||
|
662 | if skip == 0: | |
|
663 | skippedFileList = [] | |
|
664 | else: | |
|
665 | skippedFileList = fileList[cursor * | |
|
666 | skip: cursor * skip + skip] | |
|
667 | ||
|
668 | else: | |
|
669 | skippedFileList = fileList | |
|
670 | ||
|
671 | for file in skippedFileList: | |
|
659 | for file in fileList: | |
|
672 | 660 | |
|
673 | 661 | filename = os.path.join(thisPath, file) |
|
674 | 662 | |
@@ -684,12 +672,15 class JRODataReader(JRODataIO): | |||
|
684 | 672 | filenameList.append(filename) |
|
685 | 673 | datetimeList.append(thisDatetime) |
|
686 | 674 | |
|
675 | if cursor is not None and skip is not None: | |
|
676 | filenameList = filenameList[cursor * skip:cursor * skip + skip] | |
|
677 | datetimeList = datetimeList[cursor * skip:cursor * skip + skip] | |
|
678 | ||
|
687 | 679 | if not(filenameList): |
|
688 | 680 | print "[Reading] Time range selected invalid [%s - %s]: No *%s files in %s)" % (startTime, endTime, ext, path) |
|
689 | 681 | return [], [] |
|
690 | 682 | |
|
691 | 683 | print "[Reading] %d file(s) was(were) found in time range: %s - %s" % (len(filenameList), startTime, endTime) |
|
692 | ||
|
693 | 684 | |
|
694 | 685 | # for i in range(len(filenameList)): |
|
695 | 686 | # print "[Reading] %s -> [%s]" %(filenameList[i], datetimeList[i].ctime()) |
@@ -1744,7 +1735,7 class JRODataWriter(JRODataIO): | |||
|
1744 | 1735 | setFile = 0 |
|
1745 | 1736 | self.nTotalBlocks = 0 |
|
1746 | 1737 | |
|
1747 | filen = '%s%4.4d%3.3d%3.3d%s' % ( | |
|
1738 | filen = '{}{:04d}{:03d}{:03d}{}'.format( | |
|
1748 | 1739 | self.optchar, timeTuple.tm_year, timeTuple.tm_yday, setFile, ext) |
|
1749 | 1740 | |
|
1750 | 1741 | filename = os.path.join(path, subfolder, filen) |
General Comments 0
You need to be logged in to leave comments.
Login now