5. SEMI-AUTOMATIC PROCESSING OF 2400 LINES / MM GRATING SPECTRA

The preceding sections have described powerful functions for dealing with sets of raw spectra to produce a spectrally calibrated spectrum in a single step.  These tools encapsulate a large number of basic functions that can be used individually.  Normally, you do not have to use them for normal use of the LHIRES III spectrograph and SPiris software.  In the vast majority of cases you can skip the intermediate steps.  But on the premise that we use tools  much better if we know how they work, the sections that follow will give you many details about the processing steps.

This reading can also provide you with valuable information on how to produce the master images, which are essential to carry out a high quality preprocessing of  your spectra.

Finally, in some difficult cases, it is good to be able to process "manually" (semi-automatically is a more appropriate term here) if the fully automated system and is not functioning or malfunctioning.

Reading  the following section is optional, but will give you a very useful basis.

 5.1. Organisation of data

The spectra offered as examples in this section were acquired on the night of 13 to 14 June 2006 with the LHIRES III spectrograph mounted on an f/10 Celestron 11 telescope.  The grating used is the 2400 lines / mm.  The average inverse spectral dispersion is 0.115 A / pixel.  The entry slit is set to a width of 26 microns.  The resolution power is approximately R = 15000.

The main spectrum that we are dealing with here is the star Altair (Alpha Aql).  This object has the advantage of being well positioned in the sky in summer (for observers in the northern hemisphere), is bright, and has a simple spectrum, particularly useful for determining the instrument's response.

With all star spectra there must be associated at least one spectrum of a calibration lamp showing emission lines (which we know from the databases).  In LHIRES III, the internal calibration lamp produces a spectrum of neon gas.

In addition, we need to have the traditional master images needed for the preprocessing of images: an offset (bias), a dark (thermal) and a flat-field.

These are the names of the images we have for this example and their meanings:

 o-1, o-2 ...., o-19: 19 offset images

 n-1, n-2, ..., n-9: 9 dark images (300 seconds exposures made in the dark)

 f-1, f-2, ...  f-17: 17 flat-field images (images of a uniform field, or "flat")

 nf-1, nf-2, ..., nf-11: 11 dark images corresponding to the exposure time used to make flat-field images

 altair-1, altair-2, altair-3: 3 spectra of the star Altair, 120 seconds each.

All these images were windowed at 768 x 100 pixels when acquiring.  The longest axis of these images is in the direction of the dispersion of the spectrum.

Download the images (in two parts):

 - File1 altair1.zip (2.3 MB)
 
- File2 altair2.zip (2.6 MB)

 5.2. Calculation of the master images

We will calculate the three master images fundamental to any digital image processing: offset, black (or dark) and the flat-field.  Whether you are using a CCD camera or sophisticated digital cameras, the images are needed.

This part is it probably the most tedious part of processing spectra.  But this work is crucial to the quality of the results.

Fortunately,  a single master set of images can be used to treat many spectra, sometimes acquired on different nights.  It is not necessary to acquire these images for each observation session.  You just need to check from time to time that the images used  remain valid (for example, that the quality of flat-field is not damaged by changes in the amount or movement of dust).

In this tutorial, it is considered that one starts from scratch.

 5.2.1. Offset Image

The offset image is calculated by combining the 19 individual images with the  generic name "o-".  These are images made with a minimum exposure time in total darkness.

One  combines the stack of 19 images using the median values.  From the  Processing menu command select Add a sequence ... and select Median:


 
Calculating the master offset image.

Enter the generic name "-o" and the number of images in the sequence, then click OK.

The equivalent command line from the console is:

 > smedian  o-  19

Save the result under the name offset:

 > save offset


 
The offset image

A reminder about a trick that we have already used.  The number function is important in SPIris (Iris).  It returns the number of images contained in a sequence.  The sole parameter of number is the generic name of the sequence.  For example, type in the console:

 > number o-

The software returns the value 19, because there are 19 offset images.

Furthermore number loads into memory and automatically displays the first frame of the sequence (the image o-1.pic).  Elsewhere in the output window the date of the middle of the set of exposures is displayed, which is valuable to reporting the observation.  Finally, after the excecution of the command number, several fields of the SPiris dialog box  are automatically filled.  For example, if before you open the box Add a sequence... you do

 > number o-

the generic name of the input sequence field and the number of images are already filled.  A good habit before starting processing on a sequence is to run the number.

 5.2.2. Dark Image

The master dark is calculated from 9 images made in the dark.  These images are taken using 300 second exposure because it is the exposure length typically used for the acquisition of stellar spectra (of course you are free to choose your own exposure times, but remember that the dark images must be carried out with a duration similar to that of the images to be processed).  These images are named n-1, n-2 ,..., n-9.  To make sure of the number of images, do

 > number  n-

The master dark is calculated by taking the median of the 9 images n-1, n-2, ....  using Processing menu, command Add a sequence... (noting that the fields are pre-filled as a result of the previous number command):


 
Compositage of the stack of pictures of dark.

 It can also be done using the the command console:

 > smedian  n-  9

Note that at this stage the in-memory image is not exactly the master dark image.  It is the sum of the dark and offset signals.  For the master dark, it is important to remove the offset from the image resulting from the stack of the sequence n-1, n-2, ...  You have two ways to do this.

 From the command line

 > sub offset  0

Or from the menu treatment… subtraction fill the dialog box as shown in the following figure:


 
Removing the offset from the dark.

In either case, save the result as the dark:

 >save dark


 
The dark image.  Note the presence of hot spots.

We can see why the master offset is calculated before the master dark: The master offset is needed to extract the pure thermal master dark

Note that the pixels with the most intense levels often have abnormal behavior and are difficult to remove from images by simple subtraction.  These "hot" pixels can be detected then subjected to a specific treatment (such as comparing with the neighbouring pixels).  The command find_hot  is your ally in finding the hottest pixels in the image.  The find_hot function has two parameters: (1) the name of a text file which will contain the coordinates of the bad pixels, (2) a threshold beyond which every pixel found is regarded as a hot.

For example  

 > load dark
 
> find_hot  cosme  1500

Is able to locate the 50 most intense hot pixels and record their location in the file cosme (Iris / SPiris automatically adds the extension "lst" to the file name given). This file is saved in the working directory (here under the name cosme.lst - it is possible to read the contents of this file with a text editor).  You can also run find_hot several times in a row changing the threshold value.  Typically, in an image of 769 x 100 pixels, you can identify between 10 and 100 hot pixels by adjusting the threshold value (100 hot pixels represents only 0.1% of total pixels in the image).  A value of about 50 hot pixels in the cosmetics file is a good number.

 5.2.3. flat-field image

The flat-field images (or flat-field) were obtained with a diffusing material over the front of the telescope, here just a piece of tracing paper.  The diffuser is illuminated by halogen spot lamp(150 W):


 
Method used to get the flat-field.

 17 individual images were acquired (f-1 images, f-2, ..., f-17).  each of 60 seconds exposure. Click here for other methods for making a flat-field.  Immediately after acquiring the flat-field sequence, 11 exposures with the same exposure length were taken in the dark (nf-1 images, nf-2, ..., nf-11).

 Using the intermediate images with generic name "nf-" we calculate a "dark "corresponding to an exposure time of 60 seconds. One method to achieve this is to use the console:

 > smedian nf-  11
 
> save  n

 The image n.pic, stored in the working directory, contains both the thermal signal for an exposure of  60 seconds and the offset.

 If you are resistant to using the command line, you can use the Processing menu and run  Addition of a sequence ...


 
Composite dark image ( 60 seconds exposure).

 As noted above, save this dark intermediary under the name "n" (for example, but the assumption is that it is easier to type short names as long names ...).

 Questions, why have we acquired the sequence "nf-" with 60 seconds exposure, when we already have a sequence of darks "n-" of  300 seconds exposure?  The 300 second master dark image can be used to calculate the intensity of the pixels in the 60 second master dark by multiplying by the coefficient 0.2 (60 seconds / 300 = 0.2 seconds ).  However, to minimize the effects of the non-linear thermal signal characteristics of quite hot pixels in the KAF CCD family, it is always wise to treat an image with a dark achieved with a similar exposure time time.  But most importantly, the sequence of darks was made soon after the corresponding flat-field sequence, which avoids the questions about the possible changes in CCD temperature during the night (The temperature is not regulated in the Audine camera used).

 Now to subtract the the dark plus offset image (the image n) from the sequence of images  f-1, f-2, ..., f-17. Starting from a command line we can use

 >sub2  f-  i   n  0  17

 Or from the dialog box subtraction ..from a sequence  from the Processing menu:


 
Subtraction of offset and dark images from the flat-field sequence.

 It should be noted that this eliminates the thermal signal and offset components.  It is absolutely crucial to subtract these two components to generate a correct flat-field master image (zero actual intensity of the flat-field image corresponds to a zero digital value).

 In both cases, the new series of flat-field images corrected for dark and offset has the generic name "i" (i1, i2, i3, ..., i17).

 Because the signal intensity in the series of images "i" is relatively low, it was decided to calculate the arithmetic sum of the 17 images to produce the final flat-field master image:

 > add_norm i 17

Note the use of the command add_norm instead of the command add2.  With add_norm the overall intensity of the image is normalised so that the pixel level does not exceed 32700.  With add2, pixels having a value greater than 32767 after the addition of 17 pixels would be capped at the value 32767, which would bias the flat-field master.  The behavior of the order add_norm can be reproduced from the dialog box Add a sequence ... if the option normalise if overrun is checked:


 
Combining flat-field images.

 Save the flat-field master under the name flat:

 > save flat

 Here is the image:


 
The flat-field image.

 The irregularities visible in the images are local variations in the sensitivity of the detector.  It is exagerated considerably in this high-contrast view (the variation is of the order of 2% in this example).

 Nevertheless, local variations in response of a few percent can have a significant impact on the quality of the result if they are not corrected, hence the importance of acquiring a good flat-field.

 What if you do not have a flat-field?  First, we should understand that this can be detrimental to the quality of photometric data.  But in cases of force majeure ...  Load into memory a spectrum of a star to be corrected (It does not matter which star is used, it is just so the software knows the size of the image).  Then from the console type:

 > fill  20000
 
> save  flat

 All pixels of the image in memory will be set to the value 20000 (this is an arbitrary value. You can choose the one that suits you, except a zero).  Your artificial flat-field is therefore perfectly uniform (Of course it does not reflect  the exact truth, that would be too easy!).

 Here is an unusual way to acquire a flat-field using the telescope during daylight.  It is calculated by observing the solar spectrum, but to eliminate the lines in it, constantly change the angle of the grating by adjusting the micrometer throughout the exposure (it should be several seconds long).  This blurs the lines in the spectrum.  To completely eliminate the Fraunhofer lines, the median of several images is calculated.


 
Example of a flat-field calculated from observations of the solar spectrum.  The darker dust spots represent a reduction of 3% over the continuum level.

 We now have our three images OFFSET, DARK, FLAT.  The processing  of the spectra begins shortly.


 <previous>    <summary>     <next>     Page 2 / 6