Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor wagl fixes #300

Merged
merged 2 commits into from
May 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion eodatasets3/wagl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys
from datetime import datetime, timedelta
from enum import Enum
from math import isnan
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple
from uuid import UUID
Expand Down Expand Up @@ -506,6 +507,8 @@ def for_path(
)
else:
tesp_doc_path = wagl_hdf5.with_name(f"{granule_name}.tesp.yaml")

tesp_doc = None
if tesp_doc_path.exists():
with tesp_doc_path.open("r") as fl:
[tesp_doc] = loads_yaml(fl)
Expand Down Expand Up @@ -791,7 +794,7 @@ def _read_gqa_doc(p: DatasetAssembler, doc: Dict):
def _read_fmask_doc(p: DatasetAssembler, doc: Dict):
for name, value in doc["percent_class_distribution"].items():
# From Josh: fmask cloud cover trumps the L1 cloud cover.
if name == "cloud":
if name == "cloud" and not isnan(value):
if "eo:cloud_cover" in p.properties:
del p.properties["eo:cloud_cover"]
p.properties["eo:cloud_cover"] = value
Expand Down