Skip to content

Commit

Permalink
chore: crs is fixed, add yAxis
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Oct 29, 2023
1 parent 7b1e442 commit 188c60d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# local env files
**/.env
**/.venv
__pycache__
**/*.pyc

# build folder
build/
build/
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 7 additions & 5 deletions generators/generate_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 188c60d

Please sign in to comment.