Skip to content

Commit

Permalink
fix(l3): fix collecting cached data
Browse files Browse the repository at this point in the history
Also, use glacier shapes instead of complex.
  • Loading branch information
j-haacker committed Sep 23, 2024
1 parent 526a04d commit ed01156
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cryoswath/l3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ed01156

Please sign in to comment.