Skip to content

Commit

Permalink
NaN fmask should not be used as global cloud_cover
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyh committed May 2, 2023
1 parent 2fd390e commit 0cdfa16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 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 @@ -793,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

0 comments on commit 0cdfa16

Please sign in to comment.