Astronomical Spectroscopy with Modified Webcams

Webcam Spectroscopy update Aug 2005 - Staranalyser

I have recently aquired a Staranalyser from This new grating is more effective and mounted in a 1.25" filter cell. Check out the yahoogroup here. More Soon.

Introduction to webcam astronomical Spectroscopy

Remarkably, it is possible to take spectra of astronomical objects using a webcam and a fairly run of the mill amateur telescope. From Robin Leadbeater I aquired a 100 lines/mm grating for this purpose. Robin's site contains a lot of useful information on this topic.

Spectroscopy Equipment

The grating is placed in front of the sensor of the CCD camera perpendicular to lightpath from the telescope. The ccd-grating distance is about 3-4cm. This distance controls the size (or perhaps length) of the spectrum on your ccd image. The closer the grating to the camera's sensor, the shorter and brighter the spectrum. If the grating is too far away, the spectrum may not fit on the ccd camera - it will also be fainter. The grating is supplied in a 35mm slide holder. I have a very simple approach to mounting it on my Newtonian 200mm/1000mm telescope. I have taken an M42 extension ring and undone the grub screws that hold it togther. This gives two pieces - one male M42 and one female. These are glued to each side of the grating. I can now attach the grating to my telescope and the CCD camera to the grating. The CCD-grating distance can be changed with more extension rings.

As mentioned I am using modified toucam webcams, either SC1 or SC3 to take my images. The principles here apply equally well to "proper" astronomical CCD cameras such as SBIG, Artemis and Starlight Xpress etc which can be used for astronomical spectroscopy

The whole thing is mounted on the telescope as seen on the left. The black part in the very bottom of the frame is the focuser body, and the silver is the focus drawtube. Above that the parts are: Telescope M42 adapter, female half of M42 extension, grating, male part, T adapter, bayonet fitting (which is bolted to the camera).

Taking your image

I am not going into the spectroscopy imaging in detail. Its much the same as imaging any other object. Just ensure there is a visible spectrum on the screen, and then learn how to change settings as you go on. Some pointers:
If all goes well you ought to have something on the screen like the image to the right. Take a bunch of frames and stack them as normal.


After capture I do the following.
1. Stack in Registax and Save as tiff from registax.
2. Open in photoshop. Use levels to linearly move the histrogram for each channel so they coincide to get a good colour balance.
3. Turn to grey scale. Using a black and white camera would be better, if you happen to have one.
4. Rotate until the star is on the left, with the horizontal spectrum on the right.
5. Use the histogram to make all the image values dim and save from photoshop with FitsPlug and open the image in Vspec. The dimming part is because I can never get compatible FITS types and end up with saturation.
Your final image ought to look roughly like this:

Making those pretty graphs

What is a spectrum? A grating spreads out the light from the star into strip. This strip has dark bands and bright bands representing different light intensities at different wavelengths. The changes are caused by different elements in the target object either emitting light or absorbing it. It is nice to turn your band of light into a (hopefully!) meaningful graph, pointing out what elements are responsible for what.
To do this we use Vspec. This is freeware software. Its does a fantastic job, but be warned, its a bit twitchy.

1. Open the FIT from the file menu. You might have to make the image a bit dimmer in photoshop and try again. Or understand how bloody fits files work. If you don't have photoshop you'll have to use your own method. The target is to get a greyscale image of the spectrum+star in FITS format open in vspec, as shown on the left.

2. Now you have to use vpecs histogram tools to stretch the image as much as possible. Wave your mouse around on a featureless part of the image and look at the yellow I figure. Estimate a "background" minimum value. Then do the same on a bright bit of the image to find a maximum figure. Type these numbers into the low and high threshold boxes in the tool bar and press their attendant buttons. You can see I have choosen 16000 and 31000. The idea is to get a black background and the most stretched out spectrum. Don't worry about saturating the star or turning it into a black hole - as long as its there as a high contrast feature.

3. Next press the green button marked "display reference binning zone". This draws a box on the screen. I've never figured out quite how you are supposed to resize and move it about. But make sure it covers the spectrum and star.

4. Now the magic bit. Press the button marked "Reference Binning" to the right of green button. A graph will appear. If you wave your mouse around on the graph you should find it has a vertical red line in tow. You can resize the graph a bit.

5. Now you need to adjust the scales. Wave your mouse around on the flat part of the graph and look at the yellow I number. Then repeat for the highest value. Estimate some max and min values, and use the "scale Y" button to open the window that allows you to enter the hi and lo values. Then press apply. Refine your values until you get something like the image on the left. The large hump is due to the response curve of the CCD. It is possible to calibrate the image to allow for this, but I haven't worked that bit out yet. Working out how to do new things in Vspec requires a lot of tenacity. Reading the manual is not something to be undertaken lightly.

6. Next is calibration. Your image needs a scale. The scale is measured in Angstroms per pixel. An Angstrom () is a very small Swedish scientist... no no stop that... its a unit of wavelength. Your spectrum will have a scale of a certain number of /pixel. It depends on how far your grating is from the ccd and how long your telescope is. If you do not change these factors from image to image, the scale will aways be the same. The star on the left is zero. The idea is to fiddle the /pixel value until a known feature is at the correct wavelength. To calibrate this image of Vega, I happen to know that the kink to the left of the maximum should be the Hydrogen Beta line at 4861. How do I know this? Robin told me. You can use Tools>elements to see all the values. Drag the red line over the part of the graph corresponding to the star. This will put a grey dotted box on the graph. Then choose Spectrometry>>Define. Type a number such as 20 in the sampling box. Press apply. Now hold your mouse and its red line over the hydrogen beta point and look at the wavelength number. This is the number to the left of the yellow I number. Keep adjusting the sampling number until the wavelength of the Hb point is as close as you can get to 4861. Remember the sampling number for next time!

7. Now put a scale onto the graph. Press the graduations button on the right hand side of the graph window. This will put an unreadable scale on the graph. Press Scale X and fiddle the tick settings until it looks presentable.

And thats that. Well, not really. Now you can use the elements tool and work out what some of the other dips are... but thats quite enough for one tutorial. My final processed graph is shown on the left. As you can see, its not very difficult to produce nice looking professional spectrums of bright stars using amateur telescopes and CCD cameras.

Some of the results I have obtained with my SC1/3 modified toucam webcams and newtonian telescope:

Recent Images

Page last updated 2005-09-06