BIN: Compress (bin) an Image or Spectrum

   
Form: BIN source [BIN=b] [BINR=br] [BINC=bc]
[SR=sr] [SC=sc] [NORM]
source
is the image being compressed
BIN=b
compress rows and columns by integer factor 'b'
BINR=br
specify row compression
BINC=bc
specify column compression
SR=sr
give starting row of 'source' to locate region being compressed
SC=sc
give starting column in 'source'
NORM
output is average of pixel values instead of sum.
BIN compresses images by integer factors. Adjacent pixels are added together.

Use BIN= to specify a single compression factor for both rows and columns, or use BINR and BINC to specify the compression for rows and columns individually. For spectra, just use BIN. Note that

BINR
gives the amount by which rows or compressed. This shortens each row, thus producing an image with fewer columns in it.
BINC
gives the amount by which columns are compressed. This shortens each column, thus producing an image with fewer rows in it.
NORM makes the program AVERAGE adjacent pixels when compressing the image, instead of the default summing of pixel intensities.

BSR and BSC specify the starting row and column, respectively, of the region being saved. These are pixel locations in the original image. They are used to compress and save only part of an image.

The output image ALWAYS has starting row 0 and starting column 0. It does not make sense to use BIN on a wavelength-calibrated spectrum.

Examples:

BIN 4 BIN=2
compresses image 4 by a factor of 2 in rows and columns. Adjacent pixels are added. The mean of the image will be about 4 times the mean before compression.
BIN 3 BINR=6
shortens each row in image 3 by a factor of 6.
BIN 4 BIN=5 SR=200 SC=400
takes the part of the image running from row 200 to the end and from column 400 to the end, and compresses it by a factor of 2. The pixels before row 200 and column 400 are dropped from the image.