NCAR / ncl

The NCAR Command Language (NCL) is a scripting language for the analysis and visualization of climate and weather data.
http://www.ncl.ucar.edu
Other
268 stars 65 forks source link

"nan" is not supported in NCL but more and more dataset make nan as fillvalue #217

Open Yonghan33 opened 2 months ago

Yonghan33 commented 2 months ago

Describe the bug Recently, I found that the era5 dataset is different from the old CDS.

The new website to download. (https://cds-beta.climate.copernicus.eu/)

  1. The dataset's fillvalue is 'nan' , and NCL cannot recognize this fill value. Everytime I need to use the 'where' function to take it place to 9.96921e+36 or other fillvalue NCL supported. This problem also happends in the output data from python.
  2. The type of 'time' dimension is int64, which is not supported in cd_calendar function. image

ERA5 dataset is a dataset that we commonly use. I hope the official team can resolve the issue to facilitate the use of the datasets. Thanks!

Provide the following:

Computing environment

Additional context Add any other context about the problem here.

Yonghan33 commented 1 week ago

It's a good way to repalce "nan" value to fillvalue quickly. ncatted -O -a _FillValue,value_in,o,f,9.96921e+36 infile.nc Here, value_in is the float value that you need to change its fillvalue and infile is the file you have. Others as original.

KMFleischer commented 1 week ago

What about the function replace_ieeenan?

Have a look at https://www.ncl.ucar.edu/Document/Functions/Built-in/replace_ieeenan.shtml and https://www.ncl.ucar.edu/Document/Functions/Built-in/isnan_ieee.shtml

Yonghan33 commented 1 week ago

Thanks for your reply!

But NCL is slow to precess the data. Using 'ncatted' by NCO is more convenient.

 

------------------ Original ------------------ From: "NCAR/ncl" @.>; Date: Wed, Nov 13, 2024 07:07 PM @.>; @.**@.>; Subject: Re: [NCAR/ncl] "nan" is not supported in NCL but more and more dataset make nan as fillvalue (Issue #217)

What about the function replace_ieeenan?

Have a look at https://www.ncl.ucar.edu/Document/Functions/Built-in/replace_ieeenan.shtml and https://www.ncl.ucar.edu/Document/Functions/Built-in/isnan_ieee.shtml

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>