-
Notifications
You must be signed in to change notification settings - Fork 0
/
goes16_cloud_moisture.py
38 lines (31 loc) · 1.24 KB
/
goes16_cloud_moisture.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import argparse
import sys
from src.conversion_options import ConversionOptions
from src.goes16_converter import Goes16Converter
def parse_arguments():
""" Creates an ArgumentParser, adds arguments and options, and then returns
the populated name space
Returns:
Populated namespace
"""
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", dest="input_file", help="input file or pattern", default="")
parser.add_argument("-o", "--output", dest="output_file", help="output file or pattern", default="")
parser.add_argument("-d", "--debug", dest="debug", action='store_true')
parser.add_argument("-v", "--verbose", dest="verbose", action='store_true')
parser.set_defaults(verbose=False)
parser.set_defaults(debug=False)
return parser.parse_args()
def main():
args = parse_arguments()
extract_args = ConversionOptions(
filename=args.input_file,
output=args.output_file,
verbose=args.verbose,
debug=args.debug)
print(extract_args)
goes16 = Goes16Converter(verbose=extract_args.verbose, debug=extract_args.debug)
result = goes16.extract(extract_args)
if __name__ == "__main__":
print('Starting {0}'.format(str(sys.argv)))
main()