Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers



Laser Pointer Store

Spectrometer Calibration

Mosc007

Active member
Joined
Feb 2, 2012
Messages
517
Likes
145
Points
43
Calculating the numbers to Calibrate a Spectrometer requires the calculation of the 3rd order Polynomial values.

The easiest way I have found is to use an Excel Spreadsheet. I will go thru the steps involved. After you have done it once it's pretty straight forward to do.

Excel has a Plugin called "Data Analysis Tools". It's not included with the standard install of Excel so you will need to find the Plugins / Addons tab and select Data Analysis Tools and Excel will download and install it for you.

I have included an Excel Spreadsheet to get you started. Download Excel Polynomial Sheet

Once you load the Sheet into Excel you can enter your data. You will need a min of 3 sets of calibration points. The sample sheet shows 6 points. Each point consists of the Actual Wavelength and the Pixel number. The Pixel ^ 2 and Pixel ^ 3 are automaticaly calculated.


Once you enter your data you need to Click on the "Data" Tab then the "Data Analysis" Tab.




After doing that you need to select "Regression" from the box that appears. Then click ok.




The next step is to select the data input ranges. Click on the "Input Y Range" tab and highlight the values for wavelength as shown in the Pic then hit enter.




Next we need the "Input X Range". Now select all the Pixel Data. All 3 colums then hit enter.




Finnaly we need to tell Excel were to place the output results.

Click the "Output Range" button. Then Output range selection box. Now select an area on the sheet were to place the data. Were you place it is not important. Then hit enter.






Now for the magic. Click on the OK button and after a short time the output results will be displayed.




The 4 Pieces of Date we require for calibration is the 4 next to the arrow. From top to bottom.

Intercept
X Variable 1
X Variable 2
X Variable 3

That is the data to enter into the calibration box in the Spectro software.


One thing you need to be aware of is the limits of the calibration data. It is only accurate between the Max and Min calibration points. If you try to measure a laser above the Max calibration point or below the Min calibration point there will be huge errors. The Calibration curve can even wrap around at either end.

IE, If you have a Min calibration point at 490nm and try to meassure a laser at 450nm the reading will be very innacurate. The same thing will happen at the upper limit.



I have done this quickly at work. If there are errors or any questions please ask.
 
Last edited:

Agastar

New member
Joined
Sep 26, 2016
Messages
52
Likes
4
Points
0
If I do these and compare them to what I get from Spectrum Studio, should I expect similar values (provided the same input is used in both)?
 

Mosc007

Active member
Joined
Feb 2, 2012
Messages
517
Likes
145
Points
43
If I do these and compare them to what I get from Spectrum Studio, should I expect similar values (provided the same input is used in both)?
I would expect the results to be the same. I have not checked though.

I would expect the output data from any 3rd order polynomial calculation would be the same. I could not find the method so its not added to my Spectro software. It needs calculating manualy.
 
Last edited:

Agastar

New member
Joined
Sep 26, 2016
Messages
52
Likes
4
Points
0
I would expect the results to be the same. I have not checked though.

I would expect the output data from any 3rd order polynomial calculation would be the same. I could not find the method so its not added to my Spectro software. It needs calculating manualy.
Are you looking for the LeastSquares method that they used in SpectrumStudio?
 

Agastar

New member
Joined
Sep 26, 2016
Messages
52
Likes
4
Points
0
I imagine thats probably it.

Is there more than one method to calculate it ?
It was written in C# and it contains a class with several methods. This class, called LeastSquares, is called from the form frmCalibrate

Here is the list of methods and functions within this class
internal class LeastSquares
public LeastSquares()
public static double Determinant3(double[,] a)
public static double Determinant4(double[,] a)
private static double[] Fit2(List<CalibrationPoint> data)
private static double[] Fit3(List<CalibrationPoint> data)
private static double[] Fit4(List<CalibrationPoint> data)
public static double[] FitC(List<CalibrationPoint> data)
public static double[,] Inverse2(double[,] a)
public static double[,] Inverse3(double[,] a)
public static double[,] Inverse4(double[,] a)
 

chloderic

Active member
Joined
Jan 21, 2018
Messages
236
Likes
85
Points
28
It was written in C# and it contains a class with several methods. This class, called LeastSquares, is called from the form frmCalibrate

Here is the list of methods and functions within this class



Good information, maybe additinal something like this like the attachment (Labview) ?
 

Attachments

Last edited:

Mosc007

Active member
Joined
Feb 2, 2012
Messages
517
Likes
145
Points
43
It was written in C# and it contains a class with several methods. This class, called LeastSquares, is called from the form frmCalibrate

Here is the list of methods and functions within this class

I use VB6 and it does not have Leastsquares built in. I would need to find an OCX or DLL with it or write the code manualy.

I have done some quick searching on the Net but no good documantation on how the calculation is done.
 

Agastar

New member
Joined
Sep 26, 2016
Messages
52
Likes
4
Points
0
Good information, maybe additinal something like this like the attachment (Labview) ?
I used JustDecompile to view the .net assembly and that is how I found the class. It looks like they wrote it manually for their application. I didn't paste the whole code since it is probably copyrighted.

I use VB6 and it does not have Leastsquares built in. I would need to find an OCX or DLL with it or write the code manualy.

I have done some quick searching on the Net but no good documantation on how the calculation is done.
It has been about 10 years since I did anything in VB6 but I'll look through the code and see what I can do.
 

Mosc007

Active member
Joined
Feb 2, 2012
Messages
517
Likes
145
Points
43
I had some time at work to make up the holder for the 2 Spectral Discharge Tubes I bought from a science store in Australia. The holder is just some polycarbonate screwed together and some Battery Terminals from a A size battery holder.

Testing them with a 6 vdc to 20 kvac inverter it does light them up. It's not the correct supply for these tubes though. The inverter is a low current device. Most likely from a Plasma Ball.

I am not sure why yet but the Spectral Lines I found on the Net for Mercury and Helium don't line up with the paperwork that came with the tubes. I need to check which is correct.

Some quick images. The First tube (Blue Beam) is Mercury and the Second tube (Orange Beam) in Helium.

I will be using them to calibrate my Spectrometer.
 

Attachments

Agastar

New member
Joined
Sep 26, 2016
Messages
52
Likes
4
Points
0
I am sure it looks simple to a person with high level maths skills. But to me those equations don't mean much.
yeah, same here.

I had some time at work to make up the holder for the 2 Spectral Discharge Tubes I bought from a science store in Australia. The holder is just some polycarbonate screwed together and some Battery Terminals from a A size battery holder.

Testing them with a 6 vdc to 20 kvac inverter it does light them up. It's not the correct supply for these tubes though. The inverter is a low current device. Most likely from a Plasma Ball.

I am not sure why yet but the Spectral Lines I found on the Net for Mercury and Helium don't line up with the paperwork that came with the tubes. I need to check which is correct.

Some quick images. The First tube (Blue Beam) is Mercury and the Second tube (Orange Beam) in Helium.

I will be using them to calibrate my Spectrometer.
Nice holders!
 
Last edited:

chloderic

Active member
Joined
Jan 21, 2018
Messages
236
Likes
85
Points
28
Last edited:

Agastar

New member
Joined
Sep 26, 2016
Messages
52
Likes
4
Points
0
I was about to post my results from implementing the LeastSquares function in a COM visible .net dll when I saw your post. So, I grabbed the VB6 code you linked and implemented that in C# as well. Both results match what I get in Spectrum Studio.
 

Attachments





Top