Some of the most useful applications available for spectral fitting and manipulation live inside FIGARO as part of SPECDRE. Some of these applications work on individual spectra, however, others read a whole cube at once and work on each row in turn. A possible problem at this stage is that many of these applications expect the spectroscopic axis to be the first in the cube, whereas for the current generation of IFU data cubes the spectral axis is typically the third axis in the cube. KAPPA permaxes can reconfigure the cube as needed by the various packages. A full list of SPECDRE applications can be found in SUN/86.
One of the fundamental building blocks of spectral analysis is gaussian fitting, amougst other tools, FIGARO provides the fitgauss application (part of SPECDRE) to carry out this task.
FITGAUSS is especially well suited to automation inside a script. For example,
fitgauss \
in=${spectrum} mask1=${low_mask} mask2=${upp_mask} \
cont=${cont} peak=${peak} fwhm=${fwhm} reguess=no remask=no \
ncomp=1 cf=0 pf=0 wf=0 comp=${component} fitgood=yes \
centre=${position} logfil=${fitfile} device=xwin \
dialog=f
we call the fitgauss routine here specifying all the necessary
parameters, and suppressing user interaction, to allow us to
automatically fit a spectrum from inside a shell script. Here we have
specified an input file, ${spectrum} and the lower and upper
boundaries of the fitting region, ${low_mask}, and
${upp_mask}, respectively. Various initial guesses for the
fitting parameters have also been specified: the continuum level
${cont}, peak height ${peak}, full-width half-maximum
${fwhm} and the line centre ${position}. By specifying
ncomp=1 cf=0 pf=0 wf=0 we have told the application that we
want it to fit a single gaussian with the central line position, peak
height and FWHM being free to vary.
In addition we have turned off user interaction with the application,
by setting the following parameters, reguess=no,
remask=no, dialog=f and fitgood=yes.
This allows fitgauss to go about the fit without further user
intervention, displaying its resulting fit in an X-display, logging
the fit characteristics to a file (${fitfile}) and saving the
fit in the SPECDRE extension
of the NDF where it is available
for future reference and manipulation by other SPECDRE applications.
The velmap and peakmap scripts are based around the SPECDRE fitgauss application.
For data with a significantly varying continuum mfittrend is available in KAPPA to fit and
remove the continuum signal, thereby making fitgauss's job easier.
The IFU Data-Product Cookbook