diff --git a/run_prep.py b/run_prep.py new file mode 100644 index 0000000000000000000000000000000000000000..9dee2478cadd140ad8d23a590b3ef12812d8ad94 --- /dev/null +++ b/run_prep.py @@ -0,0 +1,109 @@ +"""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, + ) diff --git a/run_tests.py b/run_tests.py new file mode 100644 index 0000000000000000000000000000000000000000..f4280d84664b03358532c5217eea6d638660e906 --- /dev/null +++ b/run_tests.py @@ -0,0 +1,54 @@ +"""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, + )