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).
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
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