[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

zonal means, selective TOTAL(), etc.




I have also had the need for totalling over selective dimensions
(sometimes more than one dimension), and also MIN/MAX.

Check out my IDL web page for CMAPPLY(), which can apply quite a
number of operations to selected dimensions of an array.  You can do
this to more than one dimension at a time using a *list* of dimensions
(similar to the DIMENSIONS parameter to MAKE_ARRAY or to REFORM).

http://astrog.physics.wisc.edu/~craigm/idl/idl.html

CMAPPLY supports more than just addition;  it does:

 '+'   addition        '*'   multiplication
 'AND' logical AND     'OR'  logical OR
 'MAX' maximum         'MIN' minimum

Where possible I avoid loops to improve performance, but your mileage
may vary depending on the detailed use.  [ For example, for small
arrays, your own loop may be faster ].

Craig


-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL: craigmnet@astrog.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------