如何更正 nc 文件中的 Ref-time?

How to correct Ref-time in nc file?

如this image所示,我的数据是从1980-01-0100:00:00开始的。我希望我的参考时间是第一次进入,即 1980-01-01。但是参考时间是 1900-01-01 00:00:00。由于日历是公历,我尝试使用这两个不同的命令将日历更改为标准格式并且都有效

ncatted -a calendar,time,o,c,standard in.nc out.nc

cdo setcalendar,standard in.nc out.nc

它将 calendar:gregorian 更改为 calendar:standard 但参考时间仍然是 1900:01:01,如图所示 2 enter image description here 在这方面需要帮助。 我正在使用 cdo、R 和 python。 我怎样才能更正参考时间?

您可以通过

设置参考时间
cdo setreftime,date in.nc out.nc

See this link for details in the online manual

最后要提的是 reftime 对于大多数用途来说应该是任意的。通常,如果数据协议指定了参考时间(即您想要将模型输出上传到模型比对项目,并且他们指定他们想要特定的参考时间),那么通常只需要更改参考时间 - 事实上,参考时间不是第一个timeslice 的日期通常不是问题,日期仍然是正确的。