S C R U N C H
Figaro routine to scrunch a spectrum or set of spectra. Can scrunch
either into a linear wavelength scale, where the wavelength
increment from bin to bin is constant across the spectrum, or
into a logarithmic scale, where the increment of the log of
the wavelength from bin to bin is constant. The operation
is performed by the routine FIG_REBIN.
If the input file is 2-D data, then it is treated as a set of
1-D spectra and each is scrunched individually. If the wavelength
array is 1-D, then this single array will be used for all
the spectra. If it is 2-D, then each spectrum will be scrunched
according to the corresponding cross-section of the wavelength
array.
The routine can either conserve flux or the mean value
of the data. Conserving flux is appropriate where the data is
actually in flux units, but not when the data is in magnitude
units. (Consider the case where each input bin maps to two
output bins; if the data is in flux units - photon counts, for
example - then flux should be conserved and the mean data level
should drop by a factor 2; if the data is in magnitudes, then
the rebinning should not change the mean level.) The program
does not try to determine for itself whether the data is in flux
or in magnitudes - it uses a command keyword.
Command parameters -
SPECTRUM (Character) The name of the spectrum to be scrunched.
WSTART (Numeric) The wavelength of the CENTER of the first
bin of the resulting scrunched spectrum.
WEND (Numeric) The wavelength of the CENTER of the final
bin of the resulting scrunched spectrum. If WEND is
less than WSTART, then SCRUNCH assumes that it is the
increment rather than the final value that is being
specified. If the scrunch is logarithmic and WSTART
is greater than WEND, SCRUNCH assumes that the WEND
value represents a velocity in km/sec. These
assumptions can be controlled directly by the keywords
INCREMENT and FINAL, if they will not give the desired
effect.
BINS (Numeric) The number of bins for the resulting spectrum.
OUTPUT (Character) The name of the resulting spectrum.
Note that SCRUNCH cannot rebin a spectrum into itself
and so will always create a new output file.
Command keywords -
LOG Bin into logarithmic wavelength bins.
MEAN Conserve mean data level rather than flux.
FLUX Conserve flux rather than mean data level.
LINEAR Use linear interpolation when rebinning.
QUAD Use quadratic interpolation when rebinning.
INCREMENT WEND is an increment value, even though it is > WSTART.
FINAL WEND is a final value, even though it is < WSTART.
User variables -
SCRUNCH_INC Is set to the wavelength increment if linear
rebinning is used, and to the velocity increment if
log rebinning is used.
SCRUNCH_END Is set to the final wavelength value. (This is for
those cases where the WEND value represents an
increment.)
KS / CIT 7th Feb 1984
FIGARO A general data reduction system