Personal tools
You are here: Home Documentation Users Guide Appendix A: External Functions TAX_DATESTRING
Document Actions

TAX_DATESTRING

TAX_DATESTRING(A,B,C)
    Returns date string for time axis coordinate values.


Arguments:

A

Time steps to convert


B

A variable with the reference time axis;
indicate argument limits with "[]"


 C  Precision to return (string)

Result Axes:

X

Inherited from argument 1


Y

Inherited from argument 1


Z

Inherited from argument 1


T

Inherited from argument 1


Argument 3 is given as a string and must be enclosed in double quotes. Its values can be "year", "month", "day", "hour", "minute", "second".  Only the first 3 letters of this string is matched, so for instance, you can specify month with "mon".

Note that the variables you specify for the first two arguments will be loaded into memory.  So, rather than giving a simple variable name, it's best to specify just a variable based on its time axis, say t[gt=b]

Example:

yes? define axis/t=1-jan-1980:1-jan-1990:4/unit=days tax

yes? let date_list = t[t=29000:29900:100]
ls: ../external_functions/ext_func_x86/: No such file or directory
yes? list tax_datestring(date_list,t[gt=tax], "day")
             VARIABLE : TAX_DATESTRING(DATE_LIST,T[GT=TAX], "day")
             SUBSET   : 10 points (T)
 29000   /  1:"09-JUN-1980"
 29100   /  2:"17-SEP-1980"
 29200   /  3:"26-DEC-1980"
 29300   /  4:"05-APR-1981"
 29400   /  5:"14-JUL-1981"
 29500   /  6:"22-OCT-1981"
 29600   /  7:"30-JAN-1982"
 29700   /  8:"10-MAY-1982"
 29800   /  9:"18-AUG-1982"
 29900   / 10:"26-NOV-1982"

In this example, one COULD specify just "sst" for the second argument, but in fact the whole variable for all time steps would then be loaded into memory as the variable is passed to the function. So, just give a variable representing the time axis.


yes? use "http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/coads_sst.cdf"
yes? let tsteps = t[gt=sst,L=1200:1220:12]yes? list tax_datestring(tsteps, t[gt=sst], "year")
VARIABLE : TAX_DATESTRING(TSTEPS, T[GT=SST], "year")
DATA SET : COADS Surface Marine Observations (1854-1993)
FILENAME : coads_sst.cdf
FILEPATH : http://ferret.pmel.noaa.gov/thredds/dodsC/data/PMEL/COADS/
SUBSET : 9 points (TIME)
DEC-1953 / 1:"1953"
DEC-1954 / 2:"1954"
DEC-1955 / 3:"1955"
DEC-1956 / 4:"1956"
DEC-1957 / 5:"1957"
DEC-1958 / 6:"1958"
DEC-1959 / 7:"1959"
DEC-1960 / 8:"1960"
DEC-1961 / 9:"1961"



Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: