
                              THINKING LIKE A FERRET
    ... a brief overview of the FERRET outlook on the concepts data,
    variables, grids and other basics of FERRET life.



    PLOTTABLE VARIABLESFor this discussion we will coin the term "plottable
    variables".  There are no non-plottable variables that will come up in
    this discussion but "variables" is a bit too generic.

    PLOTTABLE VARIABLES ARE OF 4 TYPES:
    FILE VARIABLES           - read from disk files
    USER-DEFINED VARIABLES   - defined by the LET command
    DIAGNOSTIC VARIABLES     - variables from the GFDL OCEAN model
    PSEUDO-VARIABLES         - regions (I,J,K,L,X,Y,...) used as variables

    As much as possible FERRET tries to make all types of variables
    indistinguishable.

    ALL PLOTTABLE VARIABLES ARE DEFINED ON GRIDS.
    No plottable variables exists in a vacuum for FERRET.  The grid on which
    a plottable variable exists tells how to locate the variable in space and
    time.  In cases where the variables are abstract in nature - disconnected
    from space and time - FERRET will associate those variables with grids
    that are abstract, too.  Where a geographical grid will associate the Nth
    position along an axis with a location (like 20 degrees north latitude)
    an abstract grid will simply associate the Nth position with the number
    N.  Plottable variables may be regridded to other grids than the one on
    which they are defined. (Done with "G=".)

    ALL REFERENCES TO PLOTTABLE VARIABLES MUST HAVE A COMPLETE CONTEXT
    A complete context will be described in detail later - briefly it means a
    region in space, an interval in time and the data set(s) in which the
    variables will be found.


    GRIDS
    All FERRET grids are 4-dimensional.  In most cases the axes have the
    obvious interpretation of 3 space coordinates and time but sometimes the
    axes are abstract.

    A grid is composed of 4 axes - each describing the coordinates along one
    dimension.

    3d, 2d, 1d and 0d grids are regarded as special cases of the full 4
    dimensions in which 1 or more axes are set to "NORMAL".

    FERRET tries to look at all axes equally - the same syntax of regions and
    transformations applies to each.  Calendar dates, east-west longitudes
    and north-south latitudes are merely convenient ways to format positions
    along axes that have special interpretations to people - not to FERRET.
    (The only exception to this is that if the Y axis has units of LATITUDE
    FERRET will insert COSINE(LATITUDE) factors into some calculations.)



    Axes and grids may be defined by "grid files" (which normally have .GRD
    filename extensions).  Axes may also be defined by the DEFINE AXIS
    command; grids by the DEFINE GRID command.


    CONTEXTSA context is a region or point in space and time and a data
    set(s).  This is the information needed by FERRET to make sense of a
    reference to a plottable variable.  Suppose that "U" is a variable in a
    data set (file) called U_DATA.  A command like "PLOT U" is meaningful
    only when FERRET knows that it is supposed to be looking for U in data
    set U_DATA and knows where in 4-dimensional space it is supposed to plot.

    THE CONTEXT SPACE-TIME REGION MAY BE DESCRIBED BY A MIX OF SUBSCRIPT AND
    WORLD COORDINATE POSITIONS.
    Subscripts are specified by I=,J=,K=,L= for axes 1 through 4,
    respectively.  World coordinates are specified by X=,Y=,Z=,T=.
    On the right of the equal sign a single point may be given or a range
    specified by low:high may be given.  Special formats are allowed for X=
    (longitude, e.g. 160W), Y= (latitude, e.g. 23.5S) and time (calendar
    dates like "7-NOV-1989:12:35:00" in quotation marks).

    THE DATA SET MAY BE GIVEN BY NAME OR NUMBER
    The commands SET DATA and CANCEL DATA and the D= context descriptor all
    accept the name of the data set or its number.  The data sets are
    numbered by the order in which they are pointed to with SET DATA.  This
    order may be seen with SHOW DATA.

    YOU CAN TELL FERRET THE CONTEXT IN 3 PLACES
    1) THE PROGRAM CONTEXT:
       Using the commands SET REGION and SET DATA you can describe a context
    in which all commands and expressions will be interpreted.  You can
    look at the program context with SHOW REGION and SHOW DATA.  (The
    command SET DATA is used both to initialize new data sets and to make
    previously initialized sets the current program context.  When SET
    DATA initializes a new data set that set automatically becomes the
    data set for the program context.)  Example:  SET REGION/Z=50

    2) THE COMMAND CONTEXT:
       Using the command qualifiers I,J,K,L,X,Y,Z,T and D commands like
    PLOT,CONTOUR,SHADE,LIST and VECTOR can specify additional context
    information.  Command context information on any axis or on the data
    set will replace any program context information on the same axis or
    the data set.

    3) THE VARIABLE CONTEXT:
       Using the same qualifiers as the command context any plottable
    variable name can be modified with additional context information in
    square brackets (e.g. U[Z=200,D=U_DATA]).  Variable context
    information on any axis or the data set will replace any program or
    command context information on the same axis or the data set.




    TRANSFORMATIONSFERRET CAN TRANSFORM PLOTTABLE VARIABLES ALONG THEIR AXES
    Transformations may be specified only in the variable context.
    FERRET understands a number of transformations that may be specified with
    the space-time region qualifiers.  Some examples:
    PLOT U[Z=0:100@AVE]      - the variable U averaged between Z=0 and Z=100
    LIST/L=1:200 U[L=@SBX:5] - U with a boxcar smoother of width 5 points
                               along L
    also,  @FAV (fill data holes with averages)
           @DIN (definite integral)
           @IIN (indefinite integral)
           @DDC (centered derivative)
           @SHF (shift data a number of points along an axis)
           @MIN (minimum value along an axis)
       ... and others (see HELP TRANSFORMATIONS inside FERRET)

