7 from shlex
import quote
9 if __name__ ==
"__main__":
15 parser = argparse.ArgumentParser(prog=
"modis_L1A")
16 parser.add_argument(
'--version', action=
'version', version=
'%(prog)s ' + version)
17 parser.add_argument(
"filename", nargs=
'?',
18 help=
"Input L0 file", metavar=
"L0FILE")
19 parser.add_argument(
"-p",
"--parfile",
20 help=
"Parameter file containing program inputs", default=
None,metavar=
"PARFILE")
21 parser.add_argument(
"-o",
"--output",
22 help=
"Output L1A filename - defaults to '(A|T)YYYYDDDHHMMSS.L1A_LAC'", default=
None, metavar=
"L1AFILE")
23 parser.add_argument(
"-m",
"--mission",
24 help=
"MODIS mission - A(qua) or T(erra)", metavar=
"MISSION")
25 parser.add_argument(
"-s",
"--startnudge", type=float,
26 default=0, help=
"Level-0 start-time offset (seconds)", metavar=
"STARTNUDGE")
27 parser.add_argument(
"-e",
"--stopnudge", type=float,
28 default=0, help=
"Level-0 stop-time offset (seconds)", metavar=
"STOPNUDGE")
29 parser.add_argument(
"-n",
"--nextgranule",
30 help=
"Next L0 granule (for geolocation of last scan; sets stopnudge=0)", default=
None,
32 parser.add_argument(
"-v",
"--verbose", action=
"store_true",
33 default=
False, help=
"print status messages")
34 parser.add_argument(
"--log", action=
"store_true",
35 default=
False, help=
"Save processing log file(s)")
36 parser.add_argument(
"-d",
"--disableL0fix", action=
"store_false",
37 default=
True, help=
"Disable use of l0fix_modis utility for corrupt packets")
38 parser.add_argument(
"-t",
"--disablerounding", action=
"store_false",
39 default=
True, help=
"Disable rounding of granule end time to 5-min boundary")
41 args = parser.parse_args()
43 if args.parfile
is None and args.filename
is None:
49 parfile = quote(args.parfile)
53 outputfile = quote(args.output)
57 nextgranule = quote(args.nextgranule)
59 m = modisL1A.modis_l1a(filename=quote(args.filename),
62 nextgranule=nextgranule,
63 startnudge=args.startnudge,
64 stopnudge=args.stopnudge,
65 satellite=args.mission,
66 fix=args.disableL0fix,
67 rounding=args.disablerounding,