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

USER

Ref Sec38.

USER

Executes a user-written extension to the Ferret program. (This feature is deprecated and we suggest instead writing a Ferret External Function.)

yes? USER[/COMMAND=] expression_1 , expression_2, ...

The USER command is a means of incorporating custom changes in Ferret. It is currently supported only by special request to the Ferret developers. Two special features are currently accessible through the USER command‚ objective analysis and scattered sampling of grids. These commands are superceded with Version 5.0 by the functionality available through external functions.

We recommend the user access objective analysis via the script objective.jnl. The scattered sampling feature is used in the polar plotting GO tools (try "GO polar_demo" at the Ferret prompt).

 

Ref Sec38.1.

 

Objective analysis

To grid a set of (X, Y, value) triples onto a grid of specified resolution, sometimes called Objective analysis, use one of the family of "scat2grid" external functions. These SCAT2GRID functions take a set of scattered locations in 2 dimensions, a grid definition, and interpolate or average data at the scattered locations to a grid. See SCAT2GRIDGAUSS_XY, SCAT2GRIDLAPLACE_XY, and in that same chapter the functions in other 2-D directions. Also see Appendix A for functions that use binning to put data onto a grid: SCAT2GRID_BIN_XY, and the count of scattered data used in a gridding operation: SCAT2GRID_NBIN_XY and SCAT2GRID_NOBS_XY. These binning functions also have XYT versions.

yes? SHOW FUNCTION scat2grid*

The X, Y, and F(X,Y) are lists of locations and a value associated with each location. Define X and Y axes of the desired the grid and call the function to interpolate these points to the grid. Say you have a set of latitudes, longitudes, and samples of a quantity N03 at those points, and that these are in the variables my_lat, my_lon, and n03.

yes? DEFINE AXIS/X=170W:120W:5 xax5
yes? DEFINE AXIS/Y=0:40N:5 yax5
yes? LET n03_reg = scat2gridgauss_xy(my_lat, my_lon, n03, xax5, yax5, 2.,2.,2.,2.)
yes? SHADE n03_reg

See also the example in the demo script,

yes? go objective_analysis_demo

 

 

Ref Sec38.2.

 

 

Scattered sampling

Note: there was an older way of doing scattered sampling; see section 33.2 in the version 4.4 documentation)

Ferret functions are available for sampling a gridded data field. See

 

yes? SHOW FUNCTION sample*
 
SAMPLEI(DAT_TO_SAMPLE,I_INDICES)
SAMPLEJ(DAT_TO_SAMPLE,J_INDICES) ! These sample a gridded field, returning
SAMPLEK(DAT_TO_SAMPLE,K_INDICES) ! data at a set of grid points along an
SAMPLEL(DAT_TO_SAMPLE,L_INDICES) ! axis
 
SAMPLEIJ(DAT_TO_SAMPLE,XPTS,YPTS) ! Returns data sampled at a 2-dimensional
! subset of its grid points
 
SAMPLET_DATE(DAT_TO_SAMPLE,YR,MO,DAY,HR,MIN,SEC) ! Returns data sampled by
! interpolating to one or more times
 
SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS) ! Returns data sampled at a set of (X,Y)
! points, i.e., a ship track or some
! other path, using linear interpolation

 

Examples of the use of these functions are in ef_sort_demo.jnl