-1

I'm using NCO in a windows 7 command prompt to change Netcdf files with NaN to normal "missing values". I tried the approach from this question and followed this procedure :

ncatted -a _FillValue,,o,f,NaN metoffice_foam1_amm7_NWS_TBED_dm19850101.nc
ncatted -a _FillValue,,m,f,1.0e36 metoffice_foam1_amm7_NWS_TBED_dm19850101.nc

But when I try to open the output file (metoffice_foam1_amm7_NWS_TBED_dm19850101.nc) in Panoply, it gives this error: "(...) Axis includes NaN value(s)"

Please, What's wrong?

Thanks in advance

Tiago

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
user2971681
  • 21
  • 1
  • 3

2 Answers2

1

NaNs require special care. The commands above may not work for variables that are not type NC_FLOAT. Instead of using the same commands for all variables, try an NC_DOUBLE version on any variables that are double precision, e.g.,

ncatted -a _FillValue,time,o,d,NaN metoffice_foam1_amm7_NWS_TBED_dm19850101.nc
ncatted -a _FillValue,time,m,d,1.0e36 metoffice_foam1_amm7_NWS_TBED_dm19850101.nc

I would be interested to see if this solves the problem.

Charlie Zender
  • 5,929
  • 14
  • 19
0

Panoply uses the netCDF-Java library to open datasets in enhanced mode. One result of this is that if an array value matches a specified missing_value, is the _FillValue, is outside the valid_range, or is otherwise "not good", then Panoply only sees an NaN.

And the reason you get the recurring "Axis includes NaN value(s)" error is that Panoply does not like NaNs in the axis and simply is not going to let you plot along an axis that includes them.

R. Schmunk
  • 51
  • 3