You (jules) are discussing a spectrometer, that shows the strength of optical spectral lines to identify materials (http://en.wikipedia.org/wiki/Spectrometer). These are two totally different things - radio-frequency vs optical. (Just want to keep the discussion from getting totally confused.) Also, Natrium == Sodium (Na)
In my first year in a lab I built a program
that scrapes the NIST spectral database, reads the data
from a spectrum analyzer attached to the computer, and
figures out which types of atoms the thing the spectrum
analyzer is looking at contains. This is harder than it
sounds.
No no, trust me, that sounds hard. :-)Talking to the spectrometer is boring too: you have your program execute some other program that comes with the spectrometer, which talks to the spectrometer and saves a file containing a list of floating point numbers which describes a graph like this (http://upload.wikimedia.org/wikipedia/en/thumb/5/5d/Spectra-...) with data points. The floating point numbers come in a weird format that the standard floating point parsing function can't handle, so you munge it a bit with a regex.
The problem is that one element, say natrium, has many spectral lines of varying strength. You're trying to find a set of elements that best explains the measured spectrum. If you plotted all spectral lines from all elements on a spectrum, it would be completely black because there are so many. In the end it only worked well for fluorescent tubes, but it could tell you what's in them, even things a human would have a very hard time discovering by looking at the spectrum and manually comparing it to the NIST database (the university has all kinds of weird lamps like natrium lamps, blacklights, and fluorescent tubes in many colors all containing different stuff, and looking at computer monitor pixels is fun too).
My program output an element X who's name I forgot for many of the lamps, but when I plotted its spectral lines over the spectra I couldn't see the match clearly, so I added a parameter to the algorithm so that it would be more restrictive on the number of different elements returned. In the presentations of the lab the prof commented "many of these tubes also contain element X, but you can't see it with the spectrum analyzer you used, you need a higher quality one". Bummer.