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