Skip to content
Snippets Groups Projects
Commit db130a1c authored by Paolo Veglio's avatar Paolo Veglio
Browse files

new entrypoint functions for delivery

parent b3950f85
No related branches found
No related tags found
No related merge requests found
"""Main call for MVCM."""
import argparse
from pkg_resources import get_distribution # type: ignore
from mvcm.main_prep_only import main
if __name__ == "__main__":
_VERSION = get_distribution("mvcm").version
parser = argparse.ArgumentParser(prog="MVCM", description="")
parser.add_argument(
"--satellite",
help="satellite name, not case-sensitive. Available options: [snpp, ]",
choices=[
"snpp",
],
)
parser.add_argument(
"--sensor",
help="sensor name, not case-sensitive. Available options: [viirs, ]",
choices=[
"viirs",
],
)
parser.add_argument("--path", help="path where the data is stored")
parser.add_argument("--l1b", help="level 1b file name")
parser.add_argument("--geolocation", help="geolocation file name")
parser.add_argument("--hires-l1b", help="VIIRS IMG02 file name")
parser.add_argument("--hires-geo", help="VIIRS IMG03 file name")
parser.add_argument("-t", "--threshold", help="thresholds file name")
parser.add_argument(
"--atmos-1",
help="file name of the first GEOS-IT file for atmospheric parameters",
)
parser.add_argument(
"--atmos-2",
help="file name of the second GEOS-IT file for atmospheric parameters",
)
parser.add_argument("--land", help="file name of GEOS-IT land parameters")
parser.add_argument("--ocean", help="file name of GEOS-IT ocean parameters")
parser.add_argument("--constants", help="file name of GEOS-IT constants")
parser.add_argument("--ndvi", help="NDVI file name")
parser.add_argument("--sst", help="Sea surface temperature file name")
parser.add_argument("--eco", help="Ecosystem file")
parser.add_argument("-o", "--out", help="output file name")
parser.add_argument(
"-V",
"--version",
action="version",
version=_VERSION,
help="print version and exit",
)
parser.add_argument(
"-v", "--verbose", action="count", default=1, help="print verbose information"
)
parser.add_argument("-d", "--debug", action="store_true", help="activate debug mode")
parser.add_argument("--hires-only", action="store_true", help="run only high resolution code")
parser.add_argument("-x", "--mvcm-exe-path", help="path to mvcm executable")
parser.add_argument(
"--mvcm-thresholds", help="thresholds file name for operational MVCM", default=None
)
args = parser.parse_args()
satellite = args.satellite or "snpp"
sensor = args.sensor or "viirs"
data_path = args.path
mod02 = args.l1b
mod03 = args.geolocation
img02 = args.hires_l1b or None
img03 = args.hires_geo or None
threshold_file = args.threshold
geos_atm_1 = args.atmos_1
geos_atm_2 = args.atmos_2
geos_land = args.land
geos_ocean = args.ocean
constants = args.constants
ndvi_file = args.ndvi
sst_file = args.sst
eco_file = args.eco
out_file = args.out
verbose = args.verbose or False
debug = args.debug or False
main(
satellite=satellite,
sensor=sensor,
data_path=data_path,
mod02=mod02,
mod03=mod03,
img02=img02,
img03=img03,
threshold_file=threshold_file,
geos_atm_1=geos_atm_1,
geos_atm_2=geos_atm_2,
geos_land=geos_land,
geos_ocean=geos_ocean,
geos_constants=constants,
ndvi_file=ndvi_file,
eco_file=eco_file,
out_file=out_file,
verbose=verbose,
debug=debug,
exe_path=args.mvcm_exe_path,
hires_only=args.hires_only,
mvcm_threshold_file=args.mvcm_thresholds,
)
"""Main call for MVCM."""
import argparse
from pkg_resources import get_distribution # type: ignore
from mvcm.main_tests_only import main
if __name__ == "__main__":
_VERSION = get_distribution("mvcm").version
parser = argparse.ArgumentParser(prog="MVCM", description="")
parser.add_argument(
"--data",
help=(
"file name and path containing satellite data and ancillary "
"data interpolated to sensor resolution"
),
)
parser.add_argument(
"--pixel-type", help="file name and path containing all info on pixel and scene type"
)
parser.add_argument("-t", "--threshold", help="thresholds file name")
parser.add_argument(
"-v", "--verbose", action="count", default=1, help="print verbose information"
)
parser.add_argument("-o", "--out", help="output file name")
parser.add_argument("-d", "--debug", action="store_true", help="activate debug mode")
parser.add_argument("-H", "--hires", action="store_true", help="run using hires data")
parser.add_argument(
"-V",
"--version",
action="version",
version=_VERSION,
help="print version and exit",
)
args = parser.parse_args()
threshold_file = args.threshold
out_file = args.out
verbose = args.verbose or False
debug = args.debug or False
use_hires = args.hires or False
main(
threshold_file=threshold_file,
input_data=args.data,
pixel_data=args.pixel_type,
out_file=out_file,
verbose=verbose,
debug=debug,
use_hires=use_hires,
)
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