diff --git a/schainpy/model/io/jroIO_kamisr.py b/schainpy/model/io/jroIO_kamisr.py index 9a953bd..9199145 100644 --- a/schainpy/model/io/jroIO_kamisr.py +++ b/schainpy/model/io/jroIO_kamisr.py @@ -115,7 +115,7 @@ class AMISRReader(ProcessingUnit): self.searchFilesOnLine(path, startDate, endDate, startTime,endTime,walk) if not(self.filenameList): - print("There is no files into the folder: %s"%(path)) + raise schainpy.admin.SchainWarning("There is no files into the folder: %s"%(path)) sys.exit() self.fileIndex = 0 @@ -135,7 +135,7 @@ class AMISRReader(ProcessingUnit): if self.isConfig and (not self.flagNoMoreFiles): newShape = fp.get('Raw11/Data/Samples/Data').shape[1:] if self.dataShape != newShape and newShape != None: - print("\nNEW FILE HAS A DIFFERENT SHAPE") + raise schainpy.admin.SchainError("NEW FILE HAS A DIFFERENT SHAPE: ") print(self.dataShape,newShape,"\n") return 0 else: @@ -411,7 +411,7 @@ class AMISRReader(ProcessingUnit): self.fileIndex += 1 except: self.flagNoMoreFiles = 1 - print("No more Files") + raise schainpy.admin.SchainError('No more files to read') return 0 self.flagIsNewFile = 1 diff --git a/schainpy/model/io/jroIO_param.py b/schainpy/model/io/jroIO_param.py index 12fca4a..d82b830 100644 --- a/schainpy/model/io/jroIO_param.py +++ b/schainpy/model/io/jroIO_param.py @@ -285,10 +285,16 @@ class HDFReader(Reader, ProcessingUnit): self.dataOut.flagNoData = False self.blockIndex += 1 - log.log("Block No. {}/{} -> {}".format( - self.blockIndex, - self.blocksPerFile, - self.dataOut.datatime.ctime()), self.name) + if self.blockIndex == 1: + log.log("Block No. {}/{} -> {}".format( + self.blockIndex, + self.blocksPerFile, + self.dataOut.datatime.ctime()), self.name) + else: + log.log("Block No. {}/{} ".format( + self.blockIndex, + self.blocksPerFile),self.name) + return @@ -633,8 +639,10 @@ class HDFWriter(Operation): self.fp.flush() self.blockIndex += 1 - log.log('Block No. {}/{}'.format(self.blockIndex, self.blocksPerFile), self.name) - + if self.blockIndex == 1: + log.log('Block No. {}/{} --> {}'.format(self.blockIndex, self.blocksPerFile,self.dataOut.datatime.ctime()), self.name) + else: + log.log('Block No. {}/{}'.format(self.blockIndex, self.blocksPerFile), self.name) return def closeFile(self):