The default values should be equal accross all functions.

parent 173a4bc6
......@@ -35,6 +35,33 @@ band_settings = {"realistic": ("B04", "B03", "B02"),
warnings.filterwarnings("ignore")
def get_defaults():
return ({
"out_dir" : "",
"out_prefix" : "",
"out_mode" : "json",
"lat_ll" : 0.0,
"lon_ll" : 0.0,
"lat_ur" : 0.0,
"lon_ur" : 0.0,
"sensor" : "S2A",
"level" : "L2A",
"version" : "0.13",
"bands" : "",
"start_date" : "",
"end_date" : "",
"coreg" : False,
"max_cloudy" : "0.5",
"minimum_fill" : "0.12",
"utm_zone" : "",
"stack_resolution" : "10",
"rgb_extension" : "jpg",
"rgb_bands_selection" : "realistic",
"merge_tifs" : False,
"merge_tile" : None,
"onlytime" : False,
"timeout" : None
})
class Gts2Request(dict):
......@@ -877,7 +904,7 @@ if __name__ == "__main__":
help="output_directory")
parser.add_argument("-r", "--out_prefix", action="store", required=False, type=str,
help="output_prefix for naming the output files, it should not contain '_'.")
parser.add_argument("-m", "--out_mode", action="store", required=False, type=str, default="json",
parser.add_argument("-m", "--out_mode", action="store", required=False, type=str, default=get_defaults()["out_mode"],
help="output_mode, use 'json' for json-file,"
"'single' for single tiffs or 'stack' for band stack "
"'nc' for netcdf-file")
......@@ -889,40 +916,40 @@ if __name__ == "__main__":
help="latitude upper right corner")
parser.add_argument("-j", "--lon_ur", action="store", required=True, type=float,
help="longitude upper right corner")
parser.add_argument("-a", "--sensor", action="store", required=False, type=str, default="S2A",
parser.add_argument("-a", "--sensor", action="store", required=False, type=str, default=get_defaults()["sensor"],
help="sensor name (e.g. S2A) for all: S2all")
parser.add_argument("-t", "--level", action="store", required=False, type=str, default="L2A",
parser.add_argument("-t", "--level", action="store", required=False, type=str, default=get_defaults()["level"],
help="processing level (e.g. L2A)")
parser.add_argument("-v", "--version", action="store", required=False, type=str, default="0.13",
parser.add_argument("-v", "--version", action="store", required=False, type=str, default=get_defaults()["version"],
help="version of atmospheric correction (e.g. 0.10)")
parser.add_argument("-b", "--bands", action="store", required=False, type=str, default="",
parser.add_argument("-b", "--bands", action="store", required=False, type=str, default=get_defaults()["bands"],
help="list of Bands (e.g. -b B02_B03")
parser.add_argument("-s", "--start_date", action="store", required=True, type=str,
help="Startdate e.g. 20160701")
parser.add_argument("-e", "--end_date", action="store", required=True, type=str,
help="Enddate e.g. 20160701")
parser.add_argument("-c", "--coreg", action="store", required=False, type=str2bool, default=False,
parser.add_argument("-c", "--coreg", action="store", required=False, type=str2bool, default=get_defaults()["coreg"],
help="get data with corrected pixel shifts (True or False)")
parser.add_argument("-z", "--max_cloudy", action="store", required=False, type=str, default="0.5",
parser.add_argument("-z", "--max_cloudy", action="store", required=False, type=str, default=get_defaults()["max_cloudy"],
help="maximal percentage of cloudyness of requested scene (e.g. 0.5)")
parser.add_argument("-f", "--minimum_fill", action="store", required=False, type=str, default="0.12",
parser.add_argument("-f", "--minimum_fill", action="store", required=False, type=str, default=get_defaults()["minimum_fill"],
help="minimal percentage of data in scene (e.g. 1.0)")
parser.add_argument("-d", "--utm_zone", action="store", required=False, type=str, default="",
parser.add_argument("-d", "--utm_zone", action="store", required=False, type=str, default=get_defaults()["utm_zone"],
help="only return data for specific utm-zone (MGRS-tile, e.g. 33UUV)")
parser.add_argument("-g", "--stack_resolution", action="store", required=False, type=str, default="10",
parser.add_argument("-g", "--stack_resolution", action="store", required=False, type=str, default=get_defaults()["stack_resolution"],
help="spatial sampling [in meters] of the output stack file, choose from [10,20,60])")
parser.add_argument("-n", "--rgb_extension", action="store", required=False, type=str, default="jpg",
parser.add_argument("-n", "--rgb_extension", action="store", required=False, type=str, default=get_defaults()["rgb_extension"],
help="file extension of rgb files e.g.[jpg, png], default: jpg")
parser.add_argument("-q", "--rgb_bands_selection", action="store", required=False, type=str, default="realistic",
parser.add_argument("-q", "--rgb_bands_selection", action="store", required=False, type=str, default=get_defaults()["rgb_bands_selection"],
help="band selection for rgb production, choose from: [realistic, nice_looking, vegetation, "
"healthy_vegetation_urban, snow, agriculture]")
parser.add_argument("-w", "--merge_tifs", action="store", required=False, type=str2bool, default=False,
parser.add_argument("-w", "--merge_tifs", action="store", required=False, type=str2bool, default=get_defaults()["merge_tifs"],
help="Merge tifs and RGBs if area in two or more MGRS tiles per time step (True or False).")
parser.add_argument("-x", "--merge_tile", action="store", required=False, type=str, default=None,
parser.add_argument("-x", "--merge_tile", action="store", required=False, type=str, default=get_defaults()["merge_tile"],
help="Choose MGRS tile into which the merge of files is performed (e.g. 33UUV).")
parser.add_argument("-p", "--onlytime", action="store", required=False, type=str2bool, default=False,
parser.add_argument("-p", "--onlytime", action="store", required=False, type=str2bool, default=get_defaults()["onlytime"],
help="get the available timestamps for a specific request without downloading any rasterdata")
parser.add_argument("-u", "--timeout", action="store", required=False, type=int, default=None,
parser.add_argument("-u", "--timeout", action="store", required=False, type=int, default=get_defaults()["timeout"],
help="time to wait for a response from gts2 before raising a Timeout exception")
args = parser.parse_args()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment