Skip to content

Commit b414928

Browse files
authored
Merge pull request #134 from GeoscienceAustralia/granule_fix
Add fix for poor data coverage granules
2 parents 2c1c47d + cc4cd37 commit b414928

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

intertidal/composites.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@ def tidal_thresholds(
6565
return tide_thresh_low, tide_thresh_high
6666

6767

68+
def filter_granules(dataset):
69+
"""
70+
Return False for any Sentinel-2 dataset with a MGRS
71+
granule region code in the list of bad region codes.
72+
"""
73+
drop_list = ["50HKG", "50HNF", "51LWD", "51LXE", "51LZF",
74+
"52LBL", "52LCL", "52LDK", "53HNA", "53LRC",
75+
"54GYU", "54LWR", "54LXR", "54LYR", "55GBP",
76+
"55KEA", "55KFV", "55KGV", "55KHT", "55KHU",
77+
"56KKC", "56KLC", "56KMC", "56KMV", "56KNU",
78+
"54LWQ", "54LWP"]
79+
return dataset.metadata.region_code not in drop_list
80+
81+
6882
def tidal_composites(
6983
satellite_ds,
7084
threshold_lowtide=0.15,
@@ -459,6 +473,8 @@ def tidal_composites_cli(
459473
geom = None
460474

461475
# Load satellite data and dataset IDs for metadata
476+
# Use `filter_granules` predicate function to drop list of
477+
# custom Sentinel-2 MGRS granules with poor data coverage
462478
satellite_ds, dss_s2, _ = load_data(
463479
dc=dc,
464480
study_area=study_area,
@@ -476,6 +492,7 @@ def tidal_composites_cli(
476492
skip_broken_datasets=True,
477493
dataset_maturity="final",
478494
dtype="int16",
495+
dataset_predicate=filter_granules,
479496
)
480497
log.info(
481498
f"{run_id}: Found {len(satellite_ds.time)} satellite data timesteps"

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Integration tests
1010
1111
This directory contains tests that are run to verify that DEA Intertidal code runs correctly. The ``test_intertidal.py`` file runs a small-scale full workflow analysis over an intertidal flat in the Gulf of Carpentaria using the DEA Intertidal [Command Line Interface (CLI) tools](../notebooks/Intertidal_CLI.ipynb), and compares these results against a LiDAR validation DEM to produce some simple accuracy metrics.
1212

13-
The latest integration test completed at **2025-05-02 17:14**. Compared to the previous run, it had an:
13+
The latest integration test completed at **2025-05-05 11:48**. Compared to the previous run, it had an:
1414
- RMSE accuracy of **0.14 m ( :heavy_minus_sign: no change)**
1515
- MAE accuracy of **0.12 m ( :heavy_minus_sign: no change)**
1616
- Bias of **0.12 m ( :heavy_minus_sign: no change)**

tests/validation.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,4 @@ time,Correlation,RMSE,MAE,R-squared,Bias,Regression slope
110110
2025-05-02 01:43:13.002005+00:00,0.975,0.145,0.123,0.95,0.117,1.119
111111
2025-05-02 06:32:51.594612+00:00,0.975,0.145,0.123,0.95,0.117,1.119
112112
2025-05-02 07:14:19.583638+00:00,0.975,0.145,0.123,0.95,0.117,1.119
113+
2025-05-05 01:48:26.455865+00:00,0.975,0.145,0.123,0.95,0.117,1.119

tests/validation.jpg

-174 Bytes
Loading

0 commit comments

Comments
 (0)