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

adds the trio picker functionality to the minute gridder

parent bef47676
No related branches found
No related tags found
1 merge request!7Resolve "integrate trio picker with the main script, as an option"
......@@ -56,6 +56,10 @@ def create_parser():
type=float, help='center latitude (required for meso)')
parser.add_argument('--ctr-lon', metavar='longitude',
type=float, help='center longitude (required for meso)')
parser.add_argument('-1', "--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)")
# from Requirements: "Input is one or more GLM LCFA (L2+) files in mission standard format (nominally three 20-second input files)"
parser.add_argument(dest='filenames', metavar='filename', nargs='+')
return parser
......@@ -110,6 +114,19 @@ def grid_setup(args, work_dir=os.getcwd()):
min_events = None
min_groups = None
if args.realtime:
if len(args.filenames) != 1:
log.error("realtime mode only accepts one input file")
exit(1)
glminfo = parse_glm_filename(os.path.basename(args.filenames[0]))
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:
print("There are not (yet) three GLM files from this minute. This may be expected. Exiting.")
exit(0)
args.filenames = fileglob
try:
start_time, end_time = get_start_end(args.filenames)
except ValueError:
......
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