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

FINDHI

FINDHI(A,XRANGE,YRANGE) Find local maxima of a variable.

Arguments:

A

Variable in x and y, may be a function of z and/or t

 

XRANGE

Range in data units of the X radius in which the function looks for maxima

 

YRANGE

Range in data units of the Y radius in which the function looks for maxima

Result Axes:

X

ABSTRACT

 

Y

ABSTRACT: j=1:3

 

Z

Inherited from A

 

T

Inherited from A

The maxima are listed along the X axis: j=1 contains the X locations of the points, j=2 contains the Y coordinates of the points, and j=3 contains the function values at the maxima.

This function looks for the maximumm gridded value in the neighborhood x+/- XRANGE, Y+/- YRANGE. It returns only values in the interior of the region, not on boundaries. It is an implementaion of the NCAR graphics routine "minmax"

The GO script label_hi_lo.jnl makes it easy to call this function and label and label low's and high's with either their numerical value or the letters L and H. Run the demonstration script minmax_label_demo.jnl

Also try the script bullseye.jnl which locates and marks a "bullseye", i.e. a local minimum or maximum in a 2-D field within a user-specified region.

Example 1:

The function can find a set of local maxima.  For an example of finding the global maximum see the documentation for function FINDLO.

You may want to call this function after filling the data with a mean value. The method stops along lon/lat in either direction that do not represent the range requested.  For local minima or maxima this it can be useful to keep the missing data we do not search across a landmass for instance. Here we operation on the variable with its missing-data flags.

yes? use coads_climatology
 
! define a variable containing the desired region.
yes? let/like=slp var = slp[L=7,x=100:360,y=-20:60]
 
! define the findhi operation to use
yes? let low = findlo(var, 360, 180)
 
yes? shade var
yes? go fland
 
! Draw a mark at the low locations found
yes? plot/vs/over/nolab/color=red/thick/siz=0.2 low[j=1], low[j=2]

Example 2:

Now call the function after filling the data with its mean, and look for maxima on the same region.  The function finds 9 maxima using the same xrange and yrange as above.

 
yes? use coads_climatology
yes? let/like=slp/title="`slp,return=title` filled with mean value" var = missing(slp[L=7,x=100:360,y=-20:60], slp[l=7, x=100:360@ave,y=-20:60@ave])
 
yes? let high = findhi(var, 10,8)
 
yes? shade var
yes? go fland
yes? plot/vs/over/nolab/color=red/thick/siz=0.2 high[j=1], high[j=2]
 
yes? list high[i=@ngd]
VARIABLE : FINDHI(VAR, 10,8) (# of points)
FILENAME : coads_climatology.cdf
FILEPATH : /home/users/tmap/ferret/linux/fer_dsets/data/
SUBSET   : 3 points (Y)
X        : 0.5 to 5200.5 (number of valid)
TIME     : 16-JUL 20:54
1   / 1:  9.000
2   / 2:  9.000
3   / 3:  9.000
yes? list/order=y/i=1:9 high
VARIABLE : FINDHI(VAR, 10,8)
FILENAME : coads_climatology.cdf
FILEPATH : /home/users/tmap/ferret/linux/fer_dsets/data/
SUBSET   : 3 by 9 points (Y-X)
TIME     : 16-JUL 20:54
1      2      3    
1      2      3
1   / 1:   303.     5.  1017.
2   / 2:   247.    31.  1018.
3   / 3:   277.    31.  1020.
4   / 4:   323.    37.  1026.
5   / 5:   211.    39.  1026.
6   / 6:   127.    41.  1017.
7   / 7:   271.    45.  1021.
8   / 8:   157.    55.  1014.
9   / 9:   273.    57.  1018.

 

See the FINDLO documentation for another example.