Skip to content

Commit

Permalink
Ensure GeoMAD band names match the band name of C3 Landsat data. (#51)
Browse files Browse the repository at this point in the history
* Ensure GeoMAD band names match the band name of C3 Landsat data.

* Fix input spectral band names to the expected output band names.
  • Loading branch information
tebadi authored Jun 22, 2022
1 parent 3d014da commit 5479f91
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions odc/stats/plugins/gm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ def __init__(
self.cloud_filters = cloud_filters
self._renames = aux_names
self.aux_bands = tuple(
self._renames.get(k, k) for k in ("smad", "emad", "bcmad", "count")
self._renames.get(k, k)
for k in (
"smad",
"emad",
"bcmad",
"count",
)
)

self._work_chunks = work_chunks
Expand Down Expand Up @@ -164,22 +170,27 @@ def __init__(
mask_band: str = "fmask",
nodata_classes: Optional[Tuple[str, ...]] = ("nodata",),
cloud_filters: Dict[str, Iterable[Tuple[str, int]]] = None,
aux_names=dict(smad="sdev", emad="edev", bcmad="bcdev", count="count"),
aux_names=dict(
smad="sdev",
emad="edev",
bcmad="bcdev",
count="count",
),
rgb_bands=None,
**kwargs,
):
if bands is None:
bands = (
"red",
"green",
"blue",
"nir",
"swir1",
"swir2",
"nbart_red",
"nbart_red",
"nbart_blue",
"nbart_nir",
"nbart_swir_1",
"nbart_swir_2",
"nbart_contiguity",
)
if rgb_bands is None:
rgb_bands = ("red", "green", "blue")
rgb_bands = ("nbart_red", "nbart_red", "nbart_blue")

super().__init__(
bands=bands,
Expand Down

0 comments on commit 5479f91

Please sign in to comment.