[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
New Address!   --   Neue Adresse!
[Uni logo]


BOXAVE Source code in boxave.pro

BOXAVE

Name
       BOXAVE
Purpose
       Box-average a 1 or 2 dimensional array.
Explanation
       This procedure differs from the intrinsic REBIN function in the
       following 2 ways:
       (1) the box size parameter is specified rather than the output
               array size
       (2) for INTEGER arrays, BOXAVE computes intermediate steps using REAL*4
               arithmetic.   This is considerably slower than REBIN but avoids
               integer truncation
       A version of BOXAVE() that supports 64 bit integers is available for
       V5.4 or later in http://idlastro.gsfc.nasa.gov/ftp/v54/
Calling Sequence
       result = BOXAVE( Array, Xsize,[ Ysize ] )
Input Parameters
       ARRAY - Two dimensional input Array to be box-averaged.  Array may be
               one or 2 dimensions and of any type except character.
Optional Input Parameters
       XSIZE - Size of box in the X direction, over which the array is to
               be averaged.  If omitted, program will prompt for this
               parameter.
       YSIZE - For 2 dimensional arrays, the box size in the Y direction.
               If omitted, then the box size in the X and Y directions are
               assumed to be equal
Output Parameters
       RESULT - Output array after box averaging.  If the input array has
               dimensions XDIM by YDIM, then RESULT has dimensions
               XDIM/NBOX by YDIM/NBOX.  The type of RESULT is the same as
               the input array.  However, the averaging is always computed
               using REAL arithmetic, so that the calculation should be exact.
               If the box size did not exactly divide the input array, then
               then not all of the input array will be boxaveraged.
Procedure
       BOXAVE boxaverages all points simultaneously using vector subscripting
Note
       If im_int is a 512 x 512 integer array, then the two statements
               IDL> im = fix(round(rebin(float(im_int), 128, 128)))
               IDL> im  = boxave( im_int,4)
       give equivalent results.   The use of REBIN is faster, but BOXAVE is
       is less demanding on virtual memory, since one does not need to make
       a floating point copy of the entire array.
Revision History
       Written, W. Landsman, October 1986
       Call REBIN for REAL*4 and REAL*8 input arrays, W. Landsman Jan, 1992
       Removed /NOZERO in output array definition     W. Landsman 1995
       Fixed occasional integer overflow problem      W. Landsman Sep. 1995
       Allow unsigned data types                      W. Landsman Jan. 2000

Last modified by pro2html on 2002 July 02 at 03:38 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically