Skip to content

Commit

Permalink
Update nodata value
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt committed Sep 23, 2024
1 parent 169c402 commit 4c98007
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions intertidal/extents.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class that are sieved out to remove small noisy dataset
--------
extents: xarray.DataArray
A categorical xarray.DataArray depicting the following pixel classes:
- Nodata (0),
- Nodata (255),
- Ocean and coastal waters (1),
- Exposed intertidal (low confidence) (2),
- Exposed intertidal (high confidence) (3),
Expand All @@ -308,7 +308,7 @@ class that are sieved out to remove small noisy dataset
------
Classes are defined as follows:
0: Nodata
255: Nodata
1: Ocean and coastal waters
Pixels that are wet in 50% or more observations and located within
the coastal connectivity mask
Expand Down Expand Up @@ -350,7 +350,7 @@ class that are sieved out to remove small noisy dataset

# Combine all classifications - this is done one-by-one, pasting each
# new layer over the top of the existing data
extents = xr_zeros(geobox=geobox, dtype="int16") # start with 0
extents = xr_zeros(geobox=geobox, dtype="int16") + 255 # start with 255
extents.values[mostly_wet] = 1 # Add in mostly wet pixels
extents.values[mostly_wet_inland] = 4 # Add in mostly wet inland pixels on top
extents.values[urban_misclass] = (
Expand All @@ -367,6 +367,6 @@ class that are sieved out to remove small noisy dataset
extents.values[intertidal_hc] = 3

# Export to file
extents.attrs["nodata"] = 0
extents.attrs["nodata"] = 255

return extents
2 changes: 1 addition & 1 deletion metadata/ga_s2ls_intertidal_cyear_3.odc-product.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ measurements:
- name: extents
dtype: uint8
units: "class"
nodata: 0
nodata: 255

- name: ta_hat
dtype: float32
Expand Down

0 comments on commit 4c98007

Please sign in to comment.