Skip to content

Commit cd219bc

Browse files
committed
wagl metadata: Fall back to nbart time range when nbar not available
Now that nbar is being disabled for Landat scenes, this change is required so that we still include the time range in the metadata.
1 parent 33dfe90 commit cd219bc

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

eodatasets3/wagl.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,22 @@ def _create_contiguity(
458458
p: DatasetAssembler,
459459
product_list: Iterable[str],
460460
resolution_yx: Tuple[float, float],
461-
timedelta_product: str = "nbar",
462-
timedelta_data: numpy.ndarray = None,
461+
timedelta_products: Iterable[str] = ("nbar", "nbart"),
462+
timedelta_data: Optional[numpy.ndarray] = None,
463463
):
464464
"""
465465
Create the contiguity (all pixels valid) dataset.
466466
467467
Write a contiguity mask file based on the intersection of valid data pixels across all
468468
bands from the input files.
469469
"""
470+
471+
# Calculate the time range from the first that we have available
472+
timedelta_product = next(
473+
(preferred for preferred in timedelta_products if preferred in product_list),
474+
None,
475+
)
476+
470477
for product in product_list:
471478
contiguity = None
472479
# A contiguity layer for each product

0 commit comments

Comments
 (0)