GDAL changes the attribute names by prepending "GDAL_" and adds band numbers to the variable names. This should not be done. Also, it is a bit unclear to me if np.nan and netCDF fill values are treated correctly. This seems to be related to #123 as well.
Regarding the attribute and variable names, I suggest adding some "cleaning" functions at the end of the export function.
A PR related to this will also contain some other minor changes that I've made in my own fork.
Regarding the fill values, I have played with the arctic.nc test file. It turns out the fill values in that file are -10000 and not -32767 as given by the metadata:
GDAL changes the attribute names by prepending "GDAL_" and adds band numbers to the variable names. This should not be done. Also, it is a bit unclear to me if
np.nan
and netCDF fill values are treated correctly. This seems to be related to #123 as well.Regarding the attribute and variable names, I suggest adding some "cleaning" functions at the end of the export function.
A PR related to this will also contain some other minor changes that I've made in my own fork.
Regarding the fill values, I have played with the
arctic.nc
test file. It turns out the fill values in that file are -10000 and not -32767 as given by the metadata:But netCDF4 treats the data correctly:
Opening the file with nansat using python3.7 and GDAL3.0.4:
And we don't have information to mask the invalid data in Nansat
With python3.9 and GDAL3.4.1:
And here we have the same fill value in nansat:
The nansat code is the same but I'm wondering if gdal v3.4.1 masks values outside the interval
valid_min:valid_max
.What to do, except being careful when using nansat?