procedure swapaxes

Swap axes of a 3D array

Syntax
swapaxes VAR, newx, newy, newz

Arguments
VAR:   A named variable which contains a 3D FITS
newx:   Integer numer (1..3) which tells which axis shall become the X axis
newy:   Integer numer (1..3) which tells which axis shall become the Y axis
newz:   Integer numer (1..3) which tells which axis shall become the Z axis


Notes
The following FITS header keys are updated, if they exist:
CRVAL, CRPIX, CDELT, CD matrix, CTYPE, CUNIT

Examples
OSIRIS 3D data come in the format [lambda,x,y]. To convert this to [x,y,lambda]:
   swapaxes buffer, 2, 3, 1