Public Lab Research note


Equalizing area of spectral graphs for comparison

by warren | July 30, 2014 22:58 30 Jul 22:58 | #10997 | #10997

What I want to do

During the development of testing techniques with spectrometers in the Public Lab community, we've often talked about whether exposure calibration is necessary -- that is, do we have to know the total amount of light measured to be able to compare spectra of different things?

Some research I've done suggests (though I'd love to read more about it, if you have citations or links) that we can simply equalize the area under the graph line of two spectra, and compare them. We've discussed this years ago but never created a means to equalize spectra in software. I gave it a stab today and got some interesting results.

My attempt and results

I saved my code in a Gist here: https://gist.github.com/jywarren/a30ea77ad54e8aa9ae1f

And on Spectral Workbench here: https://spectralworkbench.org/macro/warren/equalize_area

You can access it by going to "More Tools" on a spectrum page, then "Macros" and choosing the "equal_area" macro. I ran it on a couple spectra of suspected crude oil from the event months ago at Parts & Crafts, but one of the two I got had low exposure and there's a lot of noise.

Here's what it looks like before; just a raw comparison:

raw-comparison.png

And here they are equalized -- the y-axis no longer means anything, but they are the same area under the curve:

equalized.png

Questions and next steps

So, it's interesting, but mostly just as a proof of concept for the script. We should really get 3-4 scans of the same sample, all at reasonable exposure (25-75% intensity) and see if they really are similar.

We should also reuse the smoothing macro in conjunction with this code, to get a closer match. I also have to work on getting both to SAVE their output, so that analyses can be shared and don't have to be run over and over. But that's a bigger project.

Why I'm interested

If we can show empirically that exposure equalization makes exposure calibration unnecessary for fluorescence spectroscopy, that would dramatically simplify the process of identifying unknown oils.


0 Comments

Login to comment.