Skip to content

Commit

Permalink
Sinergise needs a matching empty-mask skip
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyh committed Dec 21, 2023
1 parent 9ad747c commit fd6e229
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eodatasets3/wagl.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ def get_quality_masks(dataset: h5py.Dataset, granule: "Granule") -> BandMasks:
# It's in a 'qi' folder with the original filename.
if not mask_path.exists():
mask_path = level1_data_path / "qi" / Path(location).name

# Skip small ones. See reasoning in ESA block above.
if mask_path.stat().st_size < 500:
continue
masks[band_id] = (type, mask_path.as_posix())
return masks
else:
Expand Down Expand Up @@ -265,7 +269,6 @@ def mask_h5_vector(
Mask a hdf5 dataset using the gml files provided in the path.
"""
data_array = dataset[:] if hasattr(dataset, "chunks") else dataset

# Open the gml file
with fiona.open(mask_string_path) as gml:
shapes = [feature["geometry"] for feature in gml]
Expand Down

0 comments on commit fd6e229

Please sign in to comment.