Skip to content

Commit

Permalink
Basic handling to cater for Sentinel-2 data and package according to …
Browse files Browse the repository at this point in the history
…the dea_s2 naming conventions.
  • Loading branch information
Josh Sixsmith committed Dec 17, 2020
1 parent f4b1227 commit 3bdcdeb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion eodatasets3/wagl.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,15 @@ def package(
with h5py.File(granule.wagl_hdf5, "r") as fid:
granule_group = fid[granule.name]

[md] = loads_yaml(fid[granule.name + "/METADATA/CURRENT"][()])
s2_platform = "sentinel" in md["source_datasets"]["platform_id"].lower()
naming_convention = "dea_s2" if s2_platform else "dea"

with DatasetAssembler(
out_directory,
# WAGL stamps a good, random ID already.
dataset_id=granule.wagl_metadata.get("id"),
naming_conventions="dea",
naming_conventions=naming_convention,
) as p:
level1 = granule.source_level1_metadata

Expand All @@ -618,6 +622,9 @@ def package(
p.producer = "ga.gov.au"
p.product_family = "aard"

if s2_platform:
p.properties["sentinel:sentinel_tile_id"] = granule.name

_read_wagl_metadata(p, granule_group)

# Revise this later, for the moment, Sentinel-2 and
Expand Down

0 comments on commit 3bdcdeb

Please sign in to comment.