[Thread Prev][Thread Next][Index]

Re: [ferret_users] apply an offset on the time axis of a variable



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


On Wed, Apr 26, 2017 at 8:04 AM, Patrick Brockmann <patrick.brockmann@xxxxxxxxxxxx> wrote:
Hi ferreters,

Is there a way to apply an offset on the time axis of a variable ?
I would like to add for example 50 years to all dates that are described
from the coordinates axis of a variable.
I am looking for a dynamic solution not by changing values in the file.

I have found a DATES function but have not been able to find the relative
documentation or an example.

yes? show  function dates
DATES(Offsets)
    Returns a string array of dates derived from the time axis and the given offsets
    Offsets: Offsets from the time given by time axis

But nothing from
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/appendix-a

Any idea ?
Thanks

Regards
Patrick


--
Data Analysis and Visualization Engineer
LSCE/IPSL, CEA-CNRS-UVSQ laboratory
LSCE - Climate and Environment Sciences Laboratory
IPSL - Institut Pierre Simon Laplace
--


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

Privacy Policy | Disclaimer | Accessibility Statement