Loading py/cso_catalogue.py +191 −169 Original line number Diff line number Diff line # # Changes # # 2022-09, Arjo Segers, Met-Norway # Trap non-existing or empty listing files when creating catalogue of converted data. # ######################################################################## ### Loading Loading @@ -283,12 +289,26 @@ class CSO_Catalogue( CSO_CatalogueBase ) : # listing file: lstfile = self.GetSetting( 'input.listing' ) # base path, filenames are relative to listing file: inputdir = os.path.dirname( lstfile ) # info ... logging.info( 'listing file:' ) logging.info( ' %s' % lstfile ) # should exist ... if not os.path.isfile(lstfile) : logging.error( 'file not found: %s' % lstfile ) raise Exception #endif # read listing: lst = cso_file.CSO_Listing( lstfile, indent=indent ) # subset of files in timerange: df = lst.Select( tr=(t1,t2) ) # number of records: nrec = len(df) # info ... logging.info( ' records within timerange: %i' % nrec ) # any data? if nrec > 0 : # variables to be plotted: varnames = self.GetSetting( 'vars' ).split() Loading Loading @@ -471,6 +491,8 @@ class CSO_Catalogue( CSO_CatalogueBase ) : df.to_csv( os.path.join(figdir,'orbits.csv'), index=False, sep=';' ) #endfor #endif # nrec > 0 # back: os.chdir( owd ) Loading Loading
py/cso_catalogue.py +191 −169 Original line number Diff line number Diff line # # Changes # # 2022-09, Arjo Segers, Met-Norway # Trap non-existing or empty listing files when creating catalogue of converted data. # ######################################################################## ### Loading Loading @@ -283,12 +289,26 @@ class CSO_Catalogue( CSO_CatalogueBase ) : # listing file: lstfile = self.GetSetting( 'input.listing' ) # base path, filenames are relative to listing file: inputdir = os.path.dirname( lstfile ) # info ... logging.info( 'listing file:' ) logging.info( ' %s' % lstfile ) # should exist ... if not os.path.isfile(lstfile) : logging.error( 'file not found: %s' % lstfile ) raise Exception #endif # read listing: lst = cso_file.CSO_Listing( lstfile, indent=indent ) # subset of files in timerange: df = lst.Select( tr=(t1,t2) ) # number of records: nrec = len(df) # info ... logging.info( ' records within timerange: %i' % nrec ) # any data? if nrec > 0 : # variables to be plotted: varnames = self.GetSetting( 'vars' ).split() Loading Loading @@ -471,6 +491,8 @@ class CSO_Catalogue( CSO_CatalogueBase ) : df.to_csv( os.path.join(figdir,'orbits.csv'), index=False, sep=';' ) #endfor #endif # nrec > 0 # back: os.chdir( owd ) Loading