Skip to main content
  • Home
  • Documentation
  • FAQ
  • Downloads
  • Support
  • Current Release Notes
  • Ferret Users Guide
    • Users Guide Index
    • Commands Reference
    • 1. Introduction
    • 2. Data Set Basics
    • 3. Variables & Expressions
    • 4. Grids & Regions
    • 5. Animations & Gif Images
    • 6. Customizing Plots
    • 7. Handling String Data Symbols
    • 8. Working with Special Data Sets
    • 9. Computing Environment
    • 10. Converting to NetCDF
    • 11. Writing External Functions
    • Glossary
    • Appendix A: Functions
    • Appendix B: PPLUS Guide
    • Appendix C: Ferret-Specific PPLUS Enhancements
  • Previous Release Notes
  • Tutorials and Demos
    • Ferret Tour
    • DSG files: Discrete Sampling Geometries Demo
    • Ferret sorting demo
    • Fast Fourier Transforms demo
    • Empirical Orthogonal Functions demo
    • Ferret objective analysis demo
    • Ferret Palette Demo
    • Map projections
    • Ferret polygon vector demo
    • Ferret Graticules demo
    • Ferret Polytube Demo
    • Ferret Polymark Demo
    • Ferret Constant-Array demo
    • Ferret land_detail demo
    • COADS Tour
    • Levitus Tour
    • Use OPeNDAP
    • Ferret binary read demo
  • PyFerret
    • PyFerret Downloads and Install ../../faq/ferret-faqs.html
    • What is PyFerret?
    • Why use PyFerret?
    • PyFerret for the Ferret user
    • PyFerret command syntax: quick-start notes
    • PyFerret for the Python user
    • Graphics in PyFerret ?
    • New Ferret functionality
    • PyFerret Python functions and constants
    • PyFerret Python objects and methods
    • Ferret external functions in Python
    • Ferret Fortran external functions
    • PyFerret metadata-and-data dictionaries
  • OPeNDAP
    • OPeNDAP usage in Ferret
    • Use OPeNDAP Demo
    • Test OPeNDAP

1.4 COMMAND SYNTAX

Commands in program Ferret conform to the following template:

COMM [/Q1/Q2..] [SUBCOM[/S1/S2..]] [ARG1 ARG2 ..] [!comment]

where

COMM

is a command name yes? LIST

Q1..

are qualifiers of the command yes? CONTOUR/SET_UP

SUBCOM

is a subcommand name yes? SHOW MODE

S1..

are qualifiers of the subcommand yes? SET LIST/APPEND

ARG1..

are arguments of commands yes? CANCEL MODE INTERPOLATE

notes..

  • The length of the command line is limited to a maximum of 2048 characters.
     
  • Command lines ending with back slash are regarded as incomplete -- a special prompt is given to indicate that the next line is a continuation.
     
  • In the documentation, items in square brackets are optional.  In commands themselves, square brackets modify a variable with information about the context (e.g the region, data set or transformation.)
     
  • One or more spaces or tabs must separate the command from the subcommand and from each of the arguments. Spaces and tabs are optional preceding qualifiers.
     
  • Multiple commands, separated by semicolons, can be given on the same line (e.g. yes? CANCEL DATA/ALL; CANCEL VAR/ALL).
     
  • Command names, subcommand names, and qualifiers require at most 4 characters.
    (e.g., yes? CANCEL LIST/PRECISION is equivalent to yes? CANC LIST/PREC)
     
  • Some qualifiers take an argument following "=" (e.g., yes? LIST/Y=10S:10N).
     
  • An exclamation mark normally signifies the end of a command and the start of (optional) comment text.
     
  • The backslash character (\), when placed directly before an exclamation point (!), apostrophe ('), semicolon (;), or forward slash (/), will hide it ("escape it") from Ferret.
     
  • See the Expressions section for information on algebraic expressions as arguments to commands.
     
  • See the Symbols sections for information on symbol substitution in commands.

Examples:

  • A simple command and argument
    yes? LIST sst

     

  • A comment on the command line
    yes? SET REGION/L=1/X=130:290/Y=-23:23 ! January in the Tropical Pacific

     

  • Commands with qualifiers and arguments
    yes? VECTOR/L=30/COLOR=RED u,v
    yes? LET/UNITS=M ht = z[GZ=temp] - z0

     

  • Subcommands
    yes? SET MODE METAFILE
    yes? SET REGION/X=130E:120W/J=20:40/Z=0/T=1-jan-1982:31-jan-1992

     

  • Symbols used in a command. Note multiple commands on a line
    yes? DEFINE SYMBOL lower = -2; DEFINE SYMBOL upper = 6
    yes? SHADE/I=($lower):($upper) temp

     

  • Use Square brackets to specify a variable's dataset or grid, range and optionally a delta- for the variable, or a transformation )
    yes? PLOT temp[X=180,L=1:50]
    or
    yes? LIST temp[X=130:200@AVE,L=1:50:5]
    or
    yes? LET/UNITS=M ht = z[GX=temp] - z0

     

  • Immediate mode expression: enclosed in grave accents. (The expression must evaluate to a scalar, and is evaluated before the command is parsed or executed.)
    yes? CONTOUR/Z=`temp[X=180,Y=0,Z=@LOC:15]` salt

     

  • A list of values (constant array) may be formed by enclosing values in curly brackets. For example in a function call:
    yes? LET aday = DAYS1900(1989,{3,6,9},1)

     

  • Text for labels is enclosed in double quotes
    yes? VECTOR/TITLE="title_string" x_expr, y_expr

    If the string is to contain a quote, the backslash preserves it:
    yes? GO my_go_script "\"(-10,10,2)"\"
    sends the string "(-10,10,2)" to the script for more on go scripts

  •