STScI Logo

blkavg images.imgeom



blkavg -- block average or sum n-dimensional images


blkavg input output b1 b2 b3 b4 b5 b6 b7


List of images to be block averaged. Image sections are allowed.
List of output image names. If the output image name is the same as the input image name then the block averaged image replaces the input image.
The number of columns to be block averaged (dimension 1, or x).
The number of lines to be block averaged (dimension 2, or y).
The number of bands to be block averaged (dimension 3, or z).
The number of pixels to be block averaged in dimension 4 (... etc. for b5-b7).
option = "average"
Type of block average. The choices are "average" and "sum".


The list of input images are block averaged or summed to form the output images. The output image names are specified by the output list. The number of output image names must be the same as the number of input images. An output image name may be the same as the corresponding input image in which case the block averaged image replaces the input image. The last column, line, etc. of the output image may be a partial block. The option parameter selects whether to block average or block sum.


It requires approximately 10 cpu seconds to block average a 512 by 512 short image by a factor of 8 in each direction (Vax 11/750 with fpa).


1. To block average a 2-d image in blocks of 2 by 3:

cl> blkavg imagein imageout 2 3

2. To block sum two 2-d images in blocks of 5 by 5:

cl> blkavg image1,image2 out1,out2 5 5 op=sum

3. To block average a 3-d image by 4 in x and y and 2 in z:

cl> blkavg imagein imageout 4 4 2


cl> blkavg imagein imageout b1=4 b2=4 b3=2

Source Code · Search Form · STSDAS