From 70b4768b7652b81f44db5590442318168c790eeb Mon Sep 17 00:00:00 2001 From: Levi Pfantz <lpfantz@wisc.edu> Date: Thu, 9 Jan 2025 11:37:00 -0600 Subject: [PATCH] Fix error / help messages --- gridded_glm/libexec/gridded_glm/_minute_gridder.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gridded_glm/libexec/gridded_glm/_minute_gridder.py b/gridded_glm/libexec/gridded_glm/_minute_gridder.py index d47e6bc..0cbeca4 100644 --- a/gridded_glm/libexec/gridded_glm/_minute_gridder.py +++ b/gridded_glm/libexec/gridded_glm/_minute_gridder.py @@ -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 -- GitLab