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

SAMPLEI_MULTI and J, K, L, M, N

SAMPLEI_MULTI(DAT_TO_SAMPLE, I_INDICES) 

SAMPLEJ_MULTI(DAT_TO_SAMPLE,J_INDICES) 

SAMPLEK_MULTI(DAT_TO_SAMPLE, K_INDICES) 

SAMPLEL_MULTI(DAT_TO_SAMPLE, L_INDICES) 

SAMPLEM_MULTI(DAT_TO_SAMPLE,M_INDICES) 

SAMPLEN_MULTI(DAT_TO_SAMPLE, N_INDICES)

This family of functions return data sampled in the I, J, K, L, M, or N direction, at a set of indices in that direction; the indices may be a multi-directional variable.

For SAMPLEI_MULTI (and likewise for other directions):

Arguments:

DAT_TO_SAMPLE

Data to sample

 

I_INDICES

Indices to sample, which may vary in JKLMN

Result Axes:

X

Inherited from I_INDICES

 

Y

Inherited from both arguments

 

Z

Inherited from both arguments

 

T

Inherited from both arguments

 

E

Inherited from both arguments

 

F

Inherited from both arguments

Note:

SAMPLE*_MULTI are "grid-changing" functions; the output grid is different from the input arguments. Therefore it is best to use explicit limits on the first argument rather than a a SET REGION command. See the discussion of grid-changing functions.

 

Examples:

Define a 2-D variable in X and E.  Sample it  at a set of indices in the E direction.  The m-indices variable says: At x=1, sample the variable at m=4,m=3,m=2,m=1.  At x-2, sample the variable at m=5, m=4, m=3, m=2. 

yes? list var2d
VARIABLE : Variable in X-E
SUBSET   : 2 by 5 points (X-E)
0      1    
1      2
11   / 1:  137.0  130.0
12   / 2:  160.0  153.0
13   / 3:  185.0  178.0
14   / 4:  212.0  205.0
15   / 5:  241.0  234.0
 
yes? list m_indices
VARIABLE : M - indices
SUBSET   : 2 by 4 points (X-E)
0      1    
1      2
1   / 1:  4.000  5.000
2   / 2:  3.000  4.000
3   / 3:  2.000  3.000
4   / 4:  1.000  2.000
 
yes? list samplem_multi (var2d, m_indices)
VARIABLE : SAMPLEM_MULTI (VAR2D, M_INDICES)
SUBSET   : 2 by 4 points (X-E)
0      1    
1      2
1   / 1:  212.0  234.0
2   / 2:  185.0  205.0
3   / 3:  160.0  178.0
4   / 4:  137.0  153.0

If an index value points outside the grid of argument 1, the result is a missing-value at that location.  m_indices+1 contains index value m=6, which doesn't exist in on the E axis of the grid:

yes? list  m_indices+1
VARIABLE : M_INDICES+1
SUBSET   : 2 by 4 points (X-E)
0      1    
1      2
1   / 1:  5.000  6.000
2   / 2:  4.000  5.000
3   / 3:  3.000  4.000
4   / 4:  2.000  3.000
 
yes? list samplem_multi (var2d, m_indices+1)
VARIABLE : SAMPLEM_MULTI (VAR2D, M_INDICES+1)
SUBSET   : 2 by 4 points (X-E)
0      1    
1      2
1   / 1:  241.0   ...
2   / 2:  212.0  234.0
3   / 3:  185.0  205.0
4   / 4:  160.0  178.0