Skip to content
Snippets Groups Projects
Commit 70b4768b authored by Levi Pfantz's avatar Levi Pfantz
Browse files

Fix error / help messages

parent e21347b4
No related branches found
No related tags found
1 merge request!37Merge work from 1.1 into master
......@@ -88,8 +88,7 @@ def create_parser():
help="each occurrence increases verbosity 1 level through ERROR-WARNING-INFO-DEBUG\n"
"(default: ERROR)")
parser.add_argument('-l', '--log', dest="log_fn", default=None,
help="specify a log filename.\n"
"(default: print to screen).")
help="Redirect screen output to the specified log file. (default: off).")
parser.add_argument('-o', '--output-dir', metavar='OUTPUT_DIR',
default=os.getcwd(), help="output directory (default: use current directory)")
parser.add_argument('--goes-sector', default="full", choices=['full', 'conus', 'meso', 'meso1', 'meso2'],
......@@ -103,9 +102,7 @@ def create_parser():
parser.add_argument('--ctr-lon', metavar='LONGITUDE',
type=partial(bounded_float, inclusive_min=-180, inclusive_max=180), help='center longitude (required for meso)')
parser.add_argument('-r', "--realtime", default=False, action='store_true',
help="enable 'realtime' mode, where we expect only one input file,\n"
"find the surrounding trio, and automatically determine if a full minute\n"
"of data is available (default: off)")
help="Enable 'realtime' mode, where we expect onlyone input file and find\nother needed files if available. Can be called on each arriving\ninput file, but will only produce output for the 40s file, and\nonly if all 3 files for that minute are available. (default: off)")
parser.add_argument('--system-environment-prefix', default="CG",
help="set the system environment prefix for the output grids (default: CG)")
parser.add_argument('--system-environment-prefix-tiles', default="CSPP_OR",
......@@ -450,14 +447,14 @@ def main():
globstring = "{}_{}_{}_s{}*".format(glminfo[0], glminfo[1], glminfo[2], glminfo[3].strftime("%Y%j%H%M"))
fileglob = glob(os.path.join(os.path.dirname(args.filenames[0]), globstring))
if len(fileglob) != 3:
log.error("There are not yet three GLM files from this minute. This may be expected. Exiting.")
log.info("There are not yet three GLM files from this minute. This may be expected. Exiting.")
# we expect people using realtime mode to run this on every file, so a return code of 0 is expected on a file before the end of the minute
return 0
# this allows a user to use realtime mode to process a large directory of GLM without
# creating the same output file multiple times
if sorted(fileglob)[-1] != args.filenames[0]:
log.error("This is not the last file from this minute. Exiting.")
log.info("This is not the last file from this minute. Exiting.")
return 0
args.filenames = fileglob
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment