From ed0115618c9f695aa647eb2fe5a4efb61f6050e3 Mon Sep 17 00:00:00 2001 From: jan <152862650+j-haacker@users.noreply.github.com> Date: Mon, 23 Sep 2024 21:54:08 +0200 Subject: [PATCH] fix(l3): fix collecting cached data Also, use glacier shapes instead of complex. --- cryoswath/l3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cryoswath/l3.py b/cryoswath/l3.py index d601ee3..6a32455 100644 --- a/cryoswath/l3.py +++ b/cryoswath/l3.py @@ -167,7 +167,7 @@ def build_dataset(region_of_interest: str|shapely.Polygon, "processing L1b files if not available...") if isinstance(region_of_interest, str): region_id = region_of_interest - region_of_interest = load_glacier_outlines(region_id) + region_of_interest = load_glacier_outlines(region_id, "glaciers") else: region_id = "_".join([f"{region_of_interest.centroid.x:.0f}", f"{region_of_interest.centroid.y:.0f}"]) if cache_filename is None: @@ -211,7 +211,7 @@ def build_dataset(region_of_interest: str|shapely.Polygon, def collect_chunk_names(name, node): nonlocal node_list name_parts = name.split("/") - if not isinstance(node, h5py.Group) or len(name_parts) != 3 or not name_parts[0].startswith("x_"): + if not isinstance(node, h5py.Group) or len(name_parts) < 2 or not name_parts[-2].startswith("x_"): return chunk_name = name_parts[:2] if chunk_name not in node_list: