Making numpy.datetime64 coordinate variable CF-Compliant - cftime? #6563
-
I'm unable to find any examples on how to write a CF-compliant NetCDF with a time coordinate variable of type np.datetime64. The timesteps were originally as pd.Timestamp's but got automatically converted. I don't really think in terms of nanoseconds elapsed since the epoch or whatever, so could someone please point me to how I can make the conversion painlessly and produce a CF-compliant .nc? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
A simple See this page for how to precisely control the encoding. |
Beta Was this translation helpful? Give feedback.
-
@dcherian OK cool. So when running it through CF Compliance Checker I'm getting: So I just gave it a
|
Beta Was this translation helpful? Give feedback.
A simple
to_netcdf
will make sensible choices for you.See this page for how to precisely control the encoding.