Skip to content

Commit 4d68ff1

Browse files
authored
Merge pull request #159 from GeoscienceAustralia/set_nodata_nan
Ensure floating point rasters have nodata set to `NaN`
2 parents 4c21e39 + c9543e1 commit 4d68ff1

4 files changed

Lines changed: 6 additions & 2 deletions

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:

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Integration tests
1010
1111
This directory contains tests that are run to verify that DEA Intertidal code runs correctly. The ``test_intertidal.py`` file runs a small-scale full workflow analysis over an intertidal flat in the Gulf of Carpentaria using the DEA Intertidal [Command Line Interface (CLI) tools](../notebooks/Intertidal_CLI.ipynb), and compares these results against a LiDAR validation DEM to produce some simple accuracy metrics.
1212

13-
The latest integration test completed at **2026-03-19 14:33**. Compared to the previous run, it had an:
13+
The latest integration test completed at **2026-03-23 17:31**. Compared to the previous run, it had an:
1414
- RMSE accuracy of **0.14 m ( :heavy_minus_sign: no change)**
1515
- MAE accuracy of **0.12 m ( :heavy_minus_sign: no change)**
1616
- Bias of **0.12 m ( :heavy_minus_sign: no change)**

tests/validation.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,4 @@ time,Correlation,RMSE,MAE,R-squared,Bias,Regression slope
142142
2026-03-17 03:12:10.521642+00:00,0.975,0.145,0.122,0.95,0.116,1.121
143143
2026-03-19 02:11:55.124933+00:00,0.975,0.145,0.122,0.95,0.116,1.121
144144
2026-03-19 03:33:01.026986+00:00,0.975,0.145,0.122,0.95,0.116,1.121
145+
2026-03-23 06:31:50.184064+00:00,0.975,0.145,0.122,0.95,0.116,1.121

tests/validation.jpg

102 Bytes
Loading

0 commit comments

Comments
 (0)