Project

General

Profile

Replacing Fill Values/Missing Values with NaNs

Added by Simon Driscoll 12 months ago

Hello,

I have files from the Danish Meteorological Institute - temperatures and sea ice fraction. (There are two products for each, a later one and an earlier one). Hence four example netCDF files representing the two eras/products and two variables.

I believe CDO can be used to replace "Fill Values/Missing Values" with NaNs. There are many ways and options it seems to do this.

(I would like to be absolutely sure I have the correct command, as later I will regrid these files - if I understand right, if I have a missing value that is numeric (e.g. -128) and I regrid data, this could be regridded to e.g. -120, where a later check for 'Fill or Missing Values' in my regridded data would not understand, miss it, and accidentally interpret it as a real physical value.)

Therefore I think it makes sense to fill any/all FillValues and Missing Values with NaNs before regridding (as then I can just ignore any/all NaN values in my newly regridded netCDF safely), and I'd like to be absolutely sure I get them all. Is it ok (not too cheeky) to ask for the correct commands that work/do this for these specific files using CDO? I have attached them here. I can then use a for loop in bash to iterate through all 4 variants of these files.

Thank you so much!

Simon


Replies (1)

RE: Replacing Fill Values/Missing Values with NaNs - Added by Karin Meier-Fleischer 11 months ago

Hi Simon,

there is no need to replace the missing values because the _FillValue attribute is set and so the missing values are used like NaNs.

If you have a look at the files with e.g. panoply you'll see the missing areas and when remapping with CDO the remap routines take care of them.

    (1-1/1)