Skip to content

Commit

Permalink
Update contiguity expected count for new S2 logic
Browse files Browse the repository at this point in the history
We now no longer skip different resolutions on S2.
  • Loading branch information
jeremyh committed Dec 21, 2023
1 parent fd6e229 commit ea49d65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions eodatasets3/wagl.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ def get_quality_masks(dataset: h5py.Dataset, granule: "Granule") -> BandMasks:
)
info = z.getinfo(mask_offset)
# Mask under 500 bytes are empty, which kills fiona on load.
# (Non-empty ones in our scan are all far larger than 1000bytes, so this doesn't need precision)
# (From scanning, non-empty ones in our collection are all far larger than 1000bytes,
# so this doesn't need precision)
if info.file_size < 500:
continue
masks[band_id] = (
Expand All @@ -208,9 +209,9 @@ def get_quality_masks(dataset: h5py.Dataset, granule: "Granule") -> BandMasks:
for band_id in list(mtd_dict.keys()):
type, location = mtd_dict[band_id]
mask_path = level1_data_path / location
# Sinergise use the original tile metdata document, but change the directory structure
# Sinergise use the original ESA metadata document, but have a new directory structure
# So the metadata mask locations are (always?) wrong.
# It's in a 'qi' folder with the original filename.
# (It's in a 'qi' folder with the original filename)
if not mask_path.exists():
mask_path = level1_data_path / "qi" / Path(location).name

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_packagewagl.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,10 @@ def test_esa_sentinel_wagl_package(tmp_path: Path):

# Verify the computed contiguity looks the same. (metadata fields will depend on it)
[image] = expected_folder.rglob("*_oa_*nbar-contiguity.tif")
assert_image(image, nodata=255, unique_pixel_counts={0: 5367, 1: 6733})
assert_image(image, nodata=255, unique_pixel_counts={0: 5546, 1: 6554})

[image] = expected_folder.rglob("*_oa_*nbart-contiguity.tif")
assert_image(image, nodata=255, unique_pixel_counts={0: 5367, 1: 6733})
assert_image(image, nodata=255, unique_pixel_counts={0: 5546, 1: 6554})

assert_expected_eo3_path(
{
Expand Down

0 comments on commit ea49d65

Please sign in to comment.