PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label cdo-climate. Show all posts
Showing posts with label cdo-climate. Show all posts

Sunday, July 10, 2022

[FIXED] How to correct Ref-time in nc file?

 July 10, 2022     cdo-climate, python, r, reference, time     No comments   

Issue

As it is shown in this image , my data starts from 1980-01-01 00:00:00. I would like my ref time to be the first time entry i.e. 1980-01-01. But instead the ref time is 1900-01-01 00:00:00. As the calendar is gregorian, i tried to change the calendar to standard format by using these two different commands and both works

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

or

cdo setcalendar,standard in.nc out.nc

It changes the calendar:gregorian to calendar:standard but ref time is still 1900:01:01 as shown in the pic 2 enter image description here Need help in this regard. I am using cdo, R, and python. How can I correct the ref time ?


Solution

you can set the reference time with

cdo setreftime,date in.nc out.nc

See this link for details in the online manual

Just to lastly mention that the reftime should be arbitrary for most purposes. Usually one only needs to change the ref time if it is specified by a data protocol (i.e. you want to upload model output to a model intercomparison project and they specify that they want a specific reftime) - the fact that the reftime is not the first timeslice's date is usually not an issue, the dates will still be correct.



Answered By - Adrian Tompkins
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing