[Thread Prev][Thread Next][Index]

Re: [ferret_users] extracting info from axes

Hi Ge Peng,
Billy's suggestions will all work well. I have some more ideas to add as well. The RETURN= keyword will also give you access to information about the variable and grid.

If var is a variable in your dataset, then you can use `var,return= ` will give you the axis ends in the current context you have set with a "set region", and also the units of the variable or the axes. For example,

yes? set region/i=33/j=12/k=5/l=23
yes? define symbol label_ijkl = \
`var,return=xstart`, `var,return=ystart`, depth(`var,return=zunits`):, `var,return=zstart`, `var,return=tstart`

yes? show symbol label_ijkl

You can control the precision of the output by adding a precision specifier, for example, `var,RETURN=tstart,precision=3` and you can turn the labeling of the longitude and latitude outputs on or off by setting or canceling the modes LONG_LABEL and LATIT_LABEL.

The functions TAX*  also give you ways to return a date string,

yes? show function TAX*


William.S.Kessler wrote:
Hi Ge Peng -

Any quantity that is written on a default plot is available as a symbol.

For example, if you:

plot/i=242/j=14/k=22/l=8 varname

The plot and title will contain the information you want (perhaps in the upper left corner, or in the title below the plot).

AFTER making such a plot, these symbols will be found by:

yes? ppl listsym

These symbols will generally be numbered lab4, lab5, lab6, .... (lab1,2,3 are the standard Ferret info that appears in the upper right corner of the plot).

You can write these in subsequent plots as follows:

label xpos ypos center angle size ($lab4)

And, you can get fancier by noticing that these label numbers are flagged by other symbols in the list. You don't have to do that long listing every time. For example, the label for the plot longitude (if it is relevant) is flagged by the symbol labnum_x. So, you can always write the longitude by:

label xpos ypos center angle size ($lab($labnum_x))

In addition to the location identifiers, there are also the labels for the dataset (flagged by labnum_dset) and others as appropriate.

The one rule to remember is that these symbols are defined ONLY AS THE PLOT IS DRAWN. You MUST make a standard plot (without /NOLABEL) to define them before you can use them.

Billy K

On 18/02/2009, at 4:19 PM, Ge Peng wrote:

Hi Ferret Users,

Apology if this request is too elementary.

I would like to extract grid info from a data set for the purpose of
labeling. For example, for a given region/i=242/j=14/k=22/l=8, I have the
lon, lat, z, and time as follows:

yes? list x[gx=xt_ocean]
             VARIABLE : X
                        axis XT_OCEAN
             LONGITUDE: 38.5W(-38.5)
yes? list y[gy=yt_ocean]
             VARIABLE : Y
                        axis YT_OCEAN
             LATITUDE : 68.5S
yes?  list z[gz=zt_ocean]
             VARIABLE : Z
                        axis ZT_OCEAN
             DEPTH (m): 215

yes? list t[gt=TIME]
             VARIABLE : T
                        axis TIME
             TIME     : 07-FEB-1999 12:00 JULIAN

I would like to define a label, which should be something like
"38.5W, 68.5S, DEPTH (m): 215, 07-FEB-1999"

Of cause, it will be different for a different region if I change i,j,k,
or l values.

Is it a way to create the label dynamically?


--- Peng

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement