[Thread Prev][Thread Next][Index]
Re: [ferret_users] apply an offset on the time axis of a variable
Thank you Ansley for your help.
Indeed, no need to regrid on another variable. Changing the
underlaying time axis runs perfectly.
Here is a example with the classic monthly_navy_winds dataset.
I have added the calendar qualifer that was needed in my other
examples.
yes? go time_offset_00.jnl 30
Regards
Patrick
Patrick,
You can redefine the axis, then for that Ferret session the
new definition is applied to the dataset without changing the
file. If you can come up with an _expression_ that describes 50
years of time in the units of the original axis coordinates,
then it would look something like this, using a variable from
the file that has the time axis.
yes? let tt = t[gt=`var,return=taxis`]
yes? let tt_plus_50 = ...
yes? define
axis/t/t0="`var,return=t0`"/units="`var,return=tunits`
`var,return=taxis` = tt_plus_50
Ferret
will tell you it's replacing the definition of the axis.
Replacing definition of axis TIME
*** NOTE: grid used by data set mydataset
*** NOTE: Redefinition may alter apparent contents
of data set
The
family of functions TAX* give us ways to extract
information about calendar time axes which may prove
useful in setting up the tt_plus_50 variable for the new
coordinates.
I am not in the office and am unable to look up the
details of the function DATES.
-Ansley
--
Data Analysis and Visualization Engineer
LSCE/IPSL, CEA-CNRS-UVSQ laboratory
LSCE - Climate and Environment Sciences Laboratory
IPSL - Institut Pierre Simon Laplace
--
|
cancel data/all
!========================================
use monthly_navy_winds
let var=uwnd[i=@ave,j=@ave]
ppl color 6, 70,70,70
plot/grat=(dash, color=6) var[l=@sbx:12]
!========================================
say `var,return=tunits`
say `var,return=cal`
say `var,return=t0`
!========================================
let tt = t[gt=`var,return=taxis`]
define axis/t/t0="`var,return=t0`"/units="`var,return=tunits`"/calendar="`var,return=cal`" `var,return=taxis` = tt + `($01)*365*24`
plot/over var[l=@sbx:12]
Attachment:
offset.gif
Description: GIF image
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement