Estimating spectral resolution by fitting Gaussians to arc or sky lines

It is a good idea to include an estimation of the spectral resolution of your observations when describing them in a paper. There are several different quantities related to spectral resolution:

Most of these quantities vary slightly over a spectrum and depend on the precise design of the spectrograph. Older observations (mainly those using photographic plates) may use millimetres rather than pixels as their spatial unit.

I prefer to quote the reciprocal dispersion (Ångstroms per pixel) and the resolution (Ångstroms). These two quantities are related by the amount of instrumental broadening affecting your observations, which usually depends mainly on the size of the slit used when the observations were obtained.

The reciprocal dispersion is easily obtained from molly (read in your spectra and wavelength-bin them to get molly to report the average dispersion per pixel) or from the information about the spectrograph (if you trust it). The resolution should be measured from your observations.

Estimating resolution by fitting a Gaussian

Arc lamp and night sky emission lines are very sharp and can be assumed to have no intrinsic broadening. Therefore measuring their width in your extracted spectra gives a good idea of your resolution. This can be done using the mgfit command in molly, which fits combinations of Gaussians and polynomials by least squares.

Choose a stong line which is single (i.e. is not composed of two close and blended lines). mgfit is a powerful tool which requires an input file defining your fitting function:

poly: 6300. $const $grad
gaussian: 6300.3 $rv $fwhm $height

$const  = 200.0
$grad   = 0.0
$rv     = 0.0
$fwhm   = 2.0
$height = 1000.0

In this input file, there is a polynomial (with a pivot wavelength at 6300Å) to fit the continuum with two adjustable terms (the constant and the gradient). There is also a Gaussian function with a fixed reference wavelength of 6300Å and three adjustable terms: offset from the reference wavelength (expressed in km/s), FWHM (km/s) and height. Running mgfit causes the quantities const, grad, rv, fwhm and height to be adjusted to best fit your spectrum. Open molly, read in a sky spectrum and mgfit it:

load  skyo.mol  1  1  1
mgfit  1  1  2  [inputfile]  [outputfile]  -3  3  n

The output from mgfit with the input file above should be something like this:

 Fitted variable values along with their
 1-sigma 1-param uncertainties are:
 Variable: const   =  221.281885 +/-   0.554194484
 Variable: grad    =  0.06869064 +/-   0.001065056
 Variable: rv      =  14.6813215 +/-   0.648808218
 Variable: fwhm    =  2.14673494 +/-   0.027358821
 Variable: height  =  2268.01881 +/-   33.96894534

In this case the resolution is the FWHM of the Gaussian and is 2.15Å (remember that this assumes that the instrumental broadening profile can be well represented by a Gaussian). Set the plot limits, plot the spectral line in white and overplot the fit in green:

xyrange  6295  6305  0  0
plot  1  1
dcolour  3
plot  2  2
dcolour  1