Downloading routines

A tar file is available containing all of the necessary routines for running SPEC_GAUSS_CDS. This tar file is kept up-to-date on a weekly basis automatically.


The graphics window in the top left shows the spectrum to be fitted. Below that is a smaller graphics window where the residuals from the fit are plotted. Below that is a text box where details of the line fits are given.

In between the two graphics window is a small text box where help information is printed.

In the top right is a button group that controls what is plotted. The 'Data quality' button is responsible for displaying the red and yellow lines on top of the spectrum and is explained later.

Below this group is the PIXEL SELECT section that allows the user to control exactly which pixels will be fitted. More details are given below.

Next is the FIT LINES section where the user chooses graphically the initial guess for the fitting parameters and performs the fit.

Finally there are buttons for zooming into and out of the spectrum, and an exit button.

Getting started

After starting up SPEC_GAUSS_CDS, you will see the entire wavelength range of your selected band (either NIS1 or NIS2). 

IMPORTANT: a key feature of SPEC_GAUSS_CDS is that only wavelength pixels displayed in the graphics window are fitted. Thus, to fit only one line, it is necessary to zoom into the spectrum to the line you are interested in. Specific pixels in the window can be removed from the fit using the PIXEL SELECT option (see below).

To select a wavelength region, click on the ZOOM button. Now go to the graphics window and click-and-drag the mouse to select the region you are interested in. A rubber-band box will appear as you click-and-drag. To repeatedly zoom in, you will have to click on the ZOOM button each time. To zoom out, simply click on the UNZOOM button.

Performing the line fit - FIT LINES

Once the wavelength region you are interested in is displayed in the graphics window, then you are ready to fit the line(s). Click on the FIT LINES button.

If there is one line in the wavelength region, then first click on the BACKGROUND button. Now go to the graphics window and click once with the mouse to select the background level. Now click on the CHOOSE LINES button. Move the mouse cursor close to the peak of the line and click-and-drag downwards. You will see a blue rubber-band triangle appear. Adjust this so that the base of the triangle approximately corresponds to the FWHM of the emission line. Let go of the mouse button, and then click on the graphics window anywhere outside of the plot range - this exits the CHOOSE LINES stage and you are ready to do the fit.

Click on the PERFORM FIT button and you should see a yellow line appear representing the fit, together with text in the text box at the bottom of the widget giving the intensity, width (FWHM) and wavelength of the line. It is also possible for the routine to display a suggested line identification - see below for more details.

If you would like to re-do the fit with a different initial guess of the fit parameters, then click on RESET and repeat the process again. To exit the line-fitting widget, simply click on the EXIT button.

NOTE: when the user clicks on EXIT, the fit parameters are written to a file called 'spec_gauss_fits.txt'. As you go through the spectrum fitting lines, the fits get added to this file. If you would prefer for a fit not to get added to this file, press the RESET button before pressing EXIT.

Two or more lines

If there are two or more lines in the wavelength region, then the only difference is as follows: at the CHOOSE LINES stage, after selecting the first line using the blue triangle, carry on clicking-and-dragging until you've selected all the lines you want, and then click outside the plot axes to exit.

TIP: For lines that are partially blended, then it can be useful to fix their widths. Simply change the SAME WIDTHS? button to Yes.

NOTE: The Pick Widths button should allow you to choose lines by a simple click of the mouse rather than clicking-and-dragging, but it is not implemented yet!

Choosing pixels - PIXEL SELECT

After selecting the wavelength region you are interested in, there may be one or more pixels that you do not want to include in the fit. You can de-select these by clicking on the PIXEL SELECT button.

You will see a set of stars appear across the middle of the plot, one for each wavelength pixel. As an example, click on the PIXEL DE-SELECT button and go to the graphics window. Try clicking on some of the stars, and you should see them disappear. Now click anywhere outside of the plot axes, and then click on the PIXEL SELECT button. You will now be able to re-select the pixels that you had previously discarded.

The BOX SELECT/DE-SELECT buttons do the same thing, but allow consecutive groups of pixels to be switched on and off. Go to the graphics window and click-and-drag the mouse. A rubber-band box will appear, so simply adjust to select the pixels you want.

Once you have chosen your pixels, click on EXIT and then you can fit the line(s).

You can see which pixels are included in the fit at any time by clicking on the 'Chosen pixels' button in the button group at the top right of the widget.

Data quality

In the button group at the top right of the widget there's an option to plot 'Data quality', which is set on by default. It is responsible for the red dashed lines and the yellow line that you see across the spectrum.

To understand data quality, imagine that the spectrum you are analysing has been produced from averaging a block of 10 spatial pixels. Now suppose that for one wavelength pixel a cosmic ray has affected 5 of the spatial pixels, but all other wavelength pixels are free from cosmic rays. (The /NOFILL option that was applied when CDS_NEW_SPIKE was run to clean cosmic rays, flags all cosmic rays as 'missing' data that will not be used in the analysis.) What you will see is that the yellow line runs exactly along the top red dashed line for all wavelength pixels, but for the cosmic ray pixel, the yellow line will drop to half way between the red dashed lines.

Thus the red and yellow lines are a graphical way of representing how many missing pixels there are. If the yellow line gets close to the bottom red dashed line, then most of the spatial pixels are missing and so the pixel(s) should be de-selected from the fit.

Line identifications

If you have CHIANTI installed in your Solarsoft tree, then SPEC_GAUSS_CDS can make use of it to print out line identifications for the lines you fit.

Firstly, download the file cds_line_ids.txt, and create a directory to put the file in (e.g., ~/line_ids). Now in your file, add the following line:


Upon restarting IDL and running SPEC_GAUSS_CDS, you should find that line identifications are printed in the text box alongside the intensity, width and wavelength.

The line identifications are based on the author's experience of  analysing CDS data and so include only lines that are likely to be significant. There is no guarantee of completeness

WARNING: some of the line identifications may change when CHIANTI is updated. Please report any errors to Peter Young.