Skip to content
Snippets Groups Projects
Commit 0756da64 authored by Nick Bearson's avatar Nick Bearson
Browse files

add an example usage message and switch to using RawTextHelpFormatter so that...

add an example usage message and switch to using RawTextHelpFormatter so that the newlines are preserved in our description (#11)
parent a824f4fd
No related branches found
No related tags found
1 merge request!52020 02 10 beta1 high priority
......@@ -2,6 +2,15 @@
# Based on https://github.com/deeplycloudy/glmtools/blob/master/examples/grid/make_GLM_grids.py
parse_desc = """Create one minute NetCDF4 grids (and, optionally, AWIPS-compatible tiles) from GLM flash data.
Example usage:\n
cspp-geo-gglm.sh \\
--goes-sector conus \\
--create-tiles \\
-vv \\
OR_GLM-L2-LCFA_G17_s20182750032000_e20182750032200_c20182750032225.nc \\
OR_GLM-L2-LCFA_G17_s20182750032200_e20182750032400_c20182750032426.nc \\
OR_GLM-L2-LCFA_G17_s20182750032400_e20182750033000_c20182750033025.nc
"""
import numpy as np
......@@ -26,16 +35,18 @@ log = logging.getLogger(__name__)
def create_parser():
import argparse
parser = argparse.ArgumentParser(description=parse_desc)
parser = argparse.ArgumentParser(description=parse_desc, formatter_class=argparse.RawTextHelpFormatter) # RawTextHelpFormatter preserves our newlines in the example usage message
parser.add_argument('-v', '--verbose', dest='verbosity', action="count", default=0,
help='each occurrence increases verbosity 1 level through ERROR-WARNING-INFO-DEBUG (default: ERROR)')
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. (default: print to screen).")
help="specify a log filename.\n"
"(default: print to screen).")
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'],
help="If sector is meso, ctr_lon and ctr_lat "
"are interpreted as the ctr_x and ctr_y of the fixed grid."
help="If sector is meso, ctr_lon and ctr_lat \n"
"are interpreted as the ctr_x and ctr_y of the fixed grid.\n"
"(default: full)")
parser.add_argument("-t", "--create-tiles", default=False, action='store_true',
help="create AWIPS-compatible tiles (default: off)")
......
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