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

Buy Site Supporter Role (remove some ads) | LPF Donations

Links below open in new window

FrozenGate by Avery

Spectrometer Calibration

Joined
Feb 2, 2012
Messages
579
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.

27250255787_1116930447_o.jpg



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

27250255797_e6efa6f050_o.jpg



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.

27250255817_99dae99dae_o.jpg
27250255837_24b3647b84_o.jpg



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

27250255857_8ea598b25c_o.jpg
27250255867_f4e47c1a59_o.jpg



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.

27250266097_3b81635987_o.jpg
27250266127_93505d0e24_o.jpg


27250266157_0b882e90ed_o.jpg



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

27250266177_42caeb51a8_o.jpg



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:





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)?
 
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:
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?
 
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)
 
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

  • Capture.JPG
    Capture.JPG
    103.6 KB · Views: 43
Last edited:
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.
 
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.
 
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

  • IMG_20180517_190738.jpg
    IMG_20180517_190738.jpg
    29.1 KB · Views: 31
  • IMG_20180517_190408.jpg
    IMG_20180517_190408.jpg
    26.7 KB · Views: 31
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:

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

  • LeastSquaresResult.png
    LeastSquaresResult.png
    44.9 KB · Views: 25
  • LeastSquaresResult2.png
    LeastSquaresResult2.png
    43.3 KB · Views: 23


Back
Top