Skip to content

Commit d4661dd

Browse files
authored
Ensure floating point rasters have nodata set to NaN
1 parent 4c21e39 commit d4661dd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

intertidal/io.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,9 +1059,12 @@ def _prepare_band(band, custom_dtypes, float_dtype, output_location, overwrite):
10591059
band = band.fillna(int_nodata).astype(int_dtype)
10601060
band.attrs["nodata"] = int_nodata
10611061

1062-
# Export other bands as float32 data types
1062+
# Export other bands as float32 data types, ensuring
1063+
# that nodata is explicitly set to np.nan in the outputs
1064+
# due to a missing nodata issue observed in 2026 annual runs
10631065
else:
10641066
band = band.astype(float_dtype)
1067+
band.attrs["nodata"] = np.nan
10651068

10661069
# Export band to file
10671070
if output_location is not None:

0 commit comments

Comments
 (0)