Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Yonghan33 opened this issue Sep 25, 2024 · 3 comments

Comments

@Yonghan33
Copy link

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:

  • a concise NCL script demonstrating the issue (remove unnecessary code)
  • necessary data files
  • relevant graphical output
    The code I used to deal with,
    ; ----take place the fillvalue
    u@_FillValue = 9.96921e+36
    u = where(u.eq."nan", u@_FillValue, false_value)
    ; ----change the time type to integer not int64
    time0 = f->valid_time
    time = toint(time0)
    copy_VarMeta(time0, time)
    ; printVarSummary(time)
    timeARR = cd_calendar(time, 3)

Computing environment

  • OS: [Linux, Mac, or Windows]
  • OS version: [e.g. Ubuntu 16.04, MacOS 10.13.6, Windows 10]
  • NCL Version: [e.g. 6.5.0]
  • Installation method: [binary from NCAR website, conda, other package manager (apt, brew, macports, yum), built from source]

Additional context
Add any other context about the problem here.

@Yonghan33
Copy link
Author

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
Copy link
Contributor

@Yonghan33
Copy link
Author

Yonghan33 commented Nov 13, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants