4 Wrapper program for running the l1bgen program on MODIS L1A files.
7 from shlex
import quote
16 This is the primary driver function for the modis_L1B.py program.
21 parser = argparse.ArgumentParser(prog=
"modis_L1B")
22 parser.add_argument(
'--version', action=
'version', version=
'%(prog)s ' + version)
23 parser.add_argument(
"filename", nargs=
'?',
24 help=
"Input L1A file", metavar=
"L1AFILE")
25 parser.add_argument(
"geofile", nargs=
'?',
26 help=
"INPUT GEOFILE filename - defaults to basename of L1AFILE +'.GEO'", metavar=
"GEOFILE")
27 parser.add_argument(
"-p",
"--parfile",
28 help=
"Parameter file containing program inputs", metavar=
"PARFILE")
29 parser.add_argument(
"-o",
"--okm",
30 help=
"Output L1B 1KM filename - defaults to '(A|T)YYYYDDDHHMMSS.L1B_LAC'", metavar=
"1KMFILE")
32 parser.add_argument(
"-k",
"--hkm",
33 help=
"Output MODIS L1B HKM HDF filename", metavar=
"HKMFILE")
34 parser.add_argument(
"-q",
"--qkm",
35 help=
"Output MODIS L1B QKM HDF filename", metavar=
"QKMFILE")
36 parser.add_argument(
"-c",
"--obc",
37 help=
"Output MODIS L1B OBC HDF filename", metavar=
"OBCFILE")
39 parser.add_argument(
"-l",
"--lutver",
40 help=
"L1B LUT version number", metavar=
"LUTVER")
41 parser.add_argument(
"-d",
"--lutdir",
42 help=
"Path of directory containing LUT files", metavar=
"LUTDIR")
44 parser.add_argument(
"-x",
"--del-okm", action=
"store_const", const=1,
45 default=0, help=
"Delete 1km resolution L1B file")
46 parser.add_argument(
"-y",
"--del-hkm", action=
"store_const", const=2,
47 default=0, help=
"Delete 500m resolution L1B file")
48 parser.add_argument(
"-z",
"--del-qkm", action=
"store_const", const=4,
49 default=0, help=
"Delete 250m resolution L1B file")
50 parser.add_argument(
"--keep-obc", action=
"store_const", const=0,
51 default=8, help=
"Save onboard calibration file")
53 parser.add_argument(
"-v",
"--verbose", action=
"store_true",
54 default=
False, help=
"print status messages")
55 parser.add_argument(
"--log", action=
"store_true",
56 default=
False, help=
"Save processing log file(s)")
58 args = parser.parse_args()
60 if args.parfile
is None and args.filename
is None:
66 parfile = quote(args.parfile)
70 geofile = quote(args.geofile)
84 delfiles = args.del_okm + args.del_hkm + args.del_qkm + args.keep_obc
86 l1b_instance = modisL1B.ModisL1B(inp_file=quote(args.filename),
106 if __name__ ==
"__main__":