NIS_ROTATE interpolates the original data cube from the detector to remove several distortions from the data. The various distortions are the rotation of the two spectral ranges, the individual spectral line tilts, the horizontal shifts of the spectra due to the scan mirror position, and the pointing-dependent spatial shift of the NIS-1 spectrum relative to the NIS-2 spectrum.
Correction of the latter two is optional, and is implemented through the keywords /MIRROR_SHIFT and /ALIGN respectively. The spectral rotation and tilt parameters are read from databases, the latter being a polynomial expression for each spectral band. The interpolation is implemented through the IDL built-in routine POLY_2D by generating polynomial descriptions of the relationships between the original and interpolated pixels. All the different shifts between detector pixels are done simultaneously for each individual exposure.
When the /ALIGN keyword is used, then a separate pass is done to handle the inter-exposure shift in the X-direction. The default interpolation scheme is bilinear, but one can also select either /CUBIC, or set BILINEAR=0 for nearest-neighbor interpolation. However, nearest-neighbor is too coarse to correct for all of the distortions.
Notes by Bill Thompson