View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

SARITH: problems with long slit data

Frank Valdes wrote on Jul 15, 1998

Q: I have had an annoying problem with sarith, splot and the
multispec format headers. 
I have a 2D spectrum, which has been wavelength calibrated and
transformed, etc, but does not have the APNUM header parms added;
i.e. it's basically in image format. I wish to divide each row in it
by a 1D spectrum (which has a APNUM1) using sarith; this works
fine, and sarith divides and outputs all 201 apertures and
makes a multispec format image. However, the header seems confused:
imhead only shows apertures up to ~170, and splot fails while searching for
APNUM171. But, if I try hedit (image) APNUM* . on the header or indeed 
inspect the .imh file by hand with "more", all 201 aperture header 
parameters seem to be there. Should this work, or have I forgotten 
something?


A: SARITH only outputs multispec format.  So your input 2D image format
is being changed.  Now a 2D format is considered to be a collection of
1D spectra, one per line/column, and multispec format is also a
collection of 1D spectra, one per line.  So in terms of the data
the two look the same.  But multispec format has the APNUM keywords
as well as possibly other keywords.

I believe the problem you are seeing is overflowing of the allocated
memory for the header when you add many keywords.  You can control this
with the min_lenuserarea variable.  If the header is longer than the
amount allocated a task, such as IMHEAD and SPLOT, will truncate the
header.  You can increase the size with

	cl> set min_lenuserarea = 80000
	
The units are header characters.

The output of multispec format by SARITH/SCOPY on long slit data is
dangerous because you can easily end up with 1000s of keywords.  In
your case you don't have that many lines; ie 201.  For what you want to
do I suggest that instead you use IMARITH.  This will correctly divide
each row in a 2D image by a 1D image if the two are in the same
wavelength sampling.  The only reason to use SARITH is if the two
spectra have different wavelengths.  IMARITH does things in pixel space
while SARITH does things in wavelength and resamples if necessary.  I
would also operate on column oriented spectra (dispaxis of 2).  To use
IMARITH in this cause would also require transposing the long slit
spectrum.  Even if they don't have the same wavelength sampling it
might be better to run DISPCOR on the 1D spectrum to make a new
spectrum with the same dispersion as the 2D data and then use IMARITH.

Last post on Jul 15, 1998