Skip to content

Commit

Permalink
Don't override tile metadata with product
Browse files Browse the repository at this point in the history
The tile is more specific, right?
  • Loading branch information
jeremyh committed May 6, 2022
1 parent 2653284 commit b4829c9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions eodatasets3/prepare/sentinel_l1_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,16 @@ def one(suffix: str) -> str:
p.note_accessory_file("metadata:s2_tile", tile_md)

user_product_md = one("MTD_MSIL1C.xml")
p.properties.update(
process_user_product_metadata(z.read(user_product_md).decode("utf-8"))
)
for prop, value in process_user_product_metadata(
z.read(user_product_md).decode("utf-8")
).items():
if prop in p.properties:
_LOG.debug(
f"Not overridding tile metadata {prop!r} with product metadata"
)
else:
p.properties[prop] = value

p.note_accessory_file("metadata:s2_user_product", user_product_md)

return [Path(p) for p in z.namelist() if "IMG_DATA" in p and p.endswith(".jp2")]
Expand Down

0 comments on commit b4829c9

Please sign in to comment.