From 188c60dca2269601a317f73a56cecc9f88c5d94f Mon Sep 17 00:00:00 2001 From: Lubomir Dolezal Date: Sun, 29 Oct 2023 09:20:51 +0100 Subject: [PATCH] chore: crs is fixed, add yAxis --- .gitignore | 3 ++- ...ECCAP2_1_AGC_LVOD_amazonia_methods_mean_crop.yaml | 8 ++++---- generators/generate_indicators.py | 12 +++++++----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index aee621e2..0e725a6c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ # local env files **/.env +**/.venv __pycache__ **/*.pyc # build folder -build/ \ No newline at end of file +build/ diff --git a/collections/RECCAP2_1_AGC_LVOD_amazonia_methods_mean_crop.yaml b/collections/RECCAP2_1_AGC_LVOD_amazonia_methods_mean_crop.yaml index 47726510..a9e33821 100644 --- a/collections/RECCAP2_1_AGC_LVOD_amazonia_methods_mean_crop.yaml +++ b/collections/RECCAP2_1_AGC_LVOD_amazonia_methods_mean_crop.yaml @@ -18,7 +18,7 @@ Resources: Name: xcube DatacubeId: 'cop28~reccap2-9x108x139-0.0.1.zarr' Variable: 'AGC_LVOD_amazonia_methods_mean_crop' - #ColormapName: viridis - #Rescale: [0.0,100.0] -# Legend: grdi-v1-built/cm_legend.png -# Image: grdi-v1-built/preview.png + ColormapName: rain + Rescale: [0,150] +Legend: RECCAP2_1_AGC_LVOD_amazonia_methods_mean_crop/cm_legend.png +Image: RECCAP2_1_AGC_LVOD_amazonia_methods_mean_crop/preview.png diff --git a/generators/generate_indicators.py b/generators/generate_indicators.py index 0766e235..17343128 100644 --- a/generators/generate_indicators.py +++ b/generators/generate_indicators.py @@ -537,10 +537,12 @@ def add_visualization_info(stac_object, data, endpoint, file_url=None, time=None if "Rescale" in endpoint: vmin = endpoint["Rescale"][0] vmax = endpoint["Rescale"][1] - target_url = "%s/tiles/%s/%s/{z}/{x}/{y}?crs={crs}&time={time}&vmin=%s&vmax=%s&cbar=%s"%( + crs = endpoint.get("Crs", "EPSG:3857") + target_url = "%s/tiles/%s/%s/{z}/{x}/{y}?crs=%s&time={time}&vmin=%s&vmax=%s&cbar=%s"%( endpoint["EndPoint"], endpoint["DatacubeId"], endpoint["Variable"], + crs, vmin, vmax, cbar, @@ -550,7 +552,7 @@ def add_visualization_info(stac_object, data, endpoint, file_url=None, time=None rel="xyz", target=target_url, media_type="image/png", - title=data["Name"], + title="xcube tiles", ) ) pass @@ -710,7 +712,9 @@ def process_STAC_Datacube_Endpoint(config, endpoint, data, catalog): else: link.extra_fields["start_datetime"] = item.properties["start_datetime"] link.extra_fields["end_datetime"] = item.properties["end_datetime"] - + unit = variables.get(endpoint.get("Variable")).get('unit') + if unit: + data["yAxix"] = unit collection.update_extent_from_items() add_collection_information(config, collection, data) @@ -810,8 +814,6 @@ def add_collection_information(config, collection, data): def process_catalogs(folder_path, options): tasks = [] for file_name in os.listdir(folder_path): - if not 'trilateral' in file_name: - continue file_path = os.path.join(folder_path, file_name) if os.path.isfile(file_path): tasks.append(threading.Thread(target=process_catalog_file, args=(file_path, options)))