[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to modify time axis



Hi Mubashar
You can change the definition of the time axis with a DEFINE AXIS command, using the name of the time axis from the file. Then the data will be used as if it were on the new time axis.  What happens is that the data in the file will be interpreted using the time information in the new time axis.  The old definition is lost to Ferret during that session, but the input file you are reading is unchanged.  So, let's make an example:

! define a time axis and set up a variable on that axis
! Write it to an example file

yes? define axis/t=1-jan-1990:31-dec-1999:1/units=days time
yes? let var = sin(t[gt=time]/100)
yes? plot var
yes? save/clobber/file=timevar.nc var

yes? cancel variable/all
yes? cancel axis time

! Now open the file, as if we are in a new Ferret session.

yes? use timevar.nc
yes? plot var  ! it's on the 1990-1999 time axis

! redefine the time axis.  The last bit of syntax gets the name
! of the time axis for the variable "var".


yes? define axis/t=1-jan-2000:31-dec-2009:1/units=days `var,return=taxis`
Replacing definition of axis TIME
 *** NOTE: grid  used by data set timevar
 *** NOTE: Redefinition may alter apparent contents of data set

yes? plot var  ! it's on the 2000-2009 time axis

yes? save/clobber/file=timevar2000.nc/t=1-jan-2008:31-dec-2009 var
Try some more experiments. What if you redefine the axis like this (an axis with a lot more coordinate points)?  The data will be read onto the first part of the axis
yes? cancel data/all
yes? use timevar.nc
yes? define axis/t=1-jan-2000:31-jan-2001:1/units=minutes `var,return=taxis`
yes? plot var
How about this one:
yes? cancel data/all
yes? use timevar.nc
yes? define axis/t=1-jan-2000:1-jan-2002:1/units=days `var,return=taxis`
yes? plot var
On 1/9/2013 2:37 PM, Star Physicist wrote:
Dear Ferret users,

I am new to FERRET and wanted to modify time axis in my netcdf file. I have a netcdf file (with many variables) containing monthly data from jan1990 to dec1999. Can I create a netcdf file using FERRET (having all variables) after modifying the time axis to jan2000 till dec2009 instead of jan1990 to dec1999.

Thanks,

Mubashar


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement