NOAA-PMEL / Ferret

The Ferret program from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
55 stars 20 forks source link

replace SAMPLE* functions with SAMPLE*_MULTI implementation #1801

Open karlmsmith opened 6 years ago

karlmsmith commented 6 years ago

Reported by @AndrewWittenberg on 4 May 2017 15:08 UTC Problem: The SAMPLE_MULTI functions are missing from the user's guide, and also have the arguments reversed relative to the SAMPLE functions:

SAMPLEL(TO_BE_SAMPLED,T_INDICES)
    sample a field at a list of T indices
    TO_BE_SAMPLED: data to sample at list of T indices supplied
    T_INDICES: list of T indices at which to sample
SAMPLEL_MULTI(L_INDICES,DAT_TO_SAMPLE)
    Returns data sampled according to L indices which may vary in IJK
    L_INDICES: ordered indices
    DAT_TO_SAMPLE: data to sample using L indices

Suggestion: Since SAMPLE_MULTI does everything SAMPLE does and more, just replace the SAMPLE code with the multi version. But keep the interface the same as in SAMPLE, for backward compatibility.

Then just update the docs and examples to say that SAMPLE* can work on fields as well as vectors.

This would make sense, since SORT* already works on fields. So we could then just do:

yes? use coads_climatology
yes? shade/y=0 samplel(sst,sortl(sst))

Note that these functions also need to be extended to 6d.

Migrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/2529

karlmsmith commented 6 years ago

Comment by @AnsleyManke on 4 May 2017 17:10 UTC We could also issue a NOTE when sampleL etc are called.