Commit a6060200 authored by tsanona's avatar tsanona

corrections to pass tests

parent 9fd7973d
Pipeline #17632 passed with stages
......@@ -804,6 +804,11 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
if onlytime and out_mode not in ["json", "python"]:
raise AssertionError("Invalid output mode. If onlytime==True, choose either 'python' or 'json'")
if compress:
tif_opts = "COMPRESS={}_PREDICTOR={}".format(*compress.split("-")).split("_")
else:
tif_opts = None
valid_out_modes = ["json", "nc", "single", "stack", "python", "rgb"]
try:
assert out_mode in valid_out_modes
......@@ -862,8 +867,6 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
elif out_mode == "single" or out_mode == "stack":
logger.info("Converting data to %s tif-files ..." % out_mode, )
if compress:
tif_opts = "COMPRESS={}_PREDICTOR={}".format(*compress.split("-")).split("_")
tif_list = json_to_tiff(out_mode, api_result, only_tile, outpath, out_prefix, wl, level, stack_resolution,
bands, tif_opts=tif_opts, logger=logger)
if merge_tifs is True:
......@@ -874,7 +877,7 @@ def client(outpath="", out_prefix="", out_mode="json", compress="ZSTD-2" , geo_l
with tempfile.TemporaryDirectory(dir=outpath) as tmp_dir:
tif_list = json_to_tiff("stack", api_result, only_tile, tmp_dir, out_prefix, wl, level, stack_resolution,
bands, logger=logger)
bands, tif_opts=tif_opts, logger=logger)
if merge_tifs is True:
merge_tiles(tif_list, out_mode="stack", target_tile=merge_tile)
......
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