You are on page 1of 9

SPECTROMETER SPECTRAL CALIBRATION

Cyril Otieno1a, D. Fernando 1b, and Bonnie Tseng 1c


a
Rochester Institute of Technology, Chester F. Carlson Center for Imaging Science
Rochester, NY 14623 USA
ABSTRACT
Spectrometers measures the photon spectrum over a wave of wavelengths that are determined
by the grating orientation that sets the wavelength of the incidence light on the central pixel.
In order to validate the spectral measurements with any spectrometer, it is important to perform
wavelength and intensity calibration. Therefore, this report presents spectrometer calibration
process. The process was achieved using USB650 Spectrometer, Argon (A) lamp and Mercury
(Neon) HgNe lamp. A look up table was generated that mapped pixels to wavelength.
Regression models were employed in the analysis where linear, quadratic and polynomial of
order three were used to determine the accuracy of the calibration process. The latter emerged
to be the most accurate model with R2 = 0.98863.
Keywords; Calibration, spectrometer, look-up table, USB650 spectrometer, wavelength,
Mercury-neon lamp, Argon lamp
1. INTRODUCTION
Spectrometry is scientific measurement technique that is used to study, identify and quantify
electromagnetic radiations that is emitted, absorbed or scattered by materials. Spectrometers
are finding increased application in many fluorescence based measurements such as Raman
fluorescence, laser induced breakdown spectroscopy LIBS, photoluminescence etc., these
measurements require accurately identified spectral information of the wavelength position
and relative intensity of spectral peaks [1]. Therefore, this report presents the process of
spectrometer spectral calibration. The primary significance of calibration is to maintain
accuracy, standardization, repeatability in measurements, safety and instrument longevity [2].
In a typical spectroscopic system, light emitted by surface is transferred to a collimating
aperture and directed towards a diffraction grating. The grating separate the light into different
colors depending on the wavelength. The grating is free to rotate around the axis perpendicular
to the plane and passing through the center of the grating.
The diffracted light is directed towards a mirror that creates an image at the focal point of the
spectrograph. A charged couple device (CCD) is positioned here to detect and display the
intensity as a function of wavelength. Researchers have showed that if correctly calibrated,
spectrometer delivers accurate and optimized results. There are two major spectral calibrations;
wavelength calibration and intensity calibration [3].
a) Wavelength calibration
Most researchers have demonstrated that spectrometer must include wavelength calibration in
order to achieve accurate and repeatable spectral data. Therefore, Princeton Instruments have
developed a calibration system, IntelliCal that features nonlinear optimization for precise
wavelength calibration using a light emitting diode and a software driven spectrum that is
based on NIST standards [3].
A common calibration requires the detection of spectrum from an atomic emission of light
with known wavelength such as Mercury and Neon. Two or more emission lines are identified
along with their corresponding pixel position on a CCD and then interpolated to fit the gaps
between the known spectral lines. A USB powered light source is with a dual Hg or Ne lamps
are used to detect the spectral references, a table of known spectral wavelengths and their
relative intensities [4]. Many factors affect the measurement, thus the wavelength calibration
process must correct the energy at the corresponding position during subsequent calibration
data processing. The correction method is then usually employed to re-measure the position of
the energy change. Nonlinear optimization is used to refines the theoretical model parameters
to minimize any residual difference between the observed and calculated spectral intensities.
This iterative process produces a set of physical model parameters that best describes the
modeled spectrometer for calibration of subsequent acquisitions.
b) Intensity calibration
Here the main purpose is to calibrate the y axis to allow the spectrometer to detect and analyze
a sample of light source independent of the system spectral response [5]. Every instrument has
a unique spectral response making both the spectral shape and absolute intensity of a single
sample differ for every instrument and even for a single instrument at different times.
Intensity calibration is effective at eliminating the spectral response of a system from sample
data. However, it is often overlooked because of expense and difficulty in performing this type
of calibration. Intensity calibration system requires NIST traceable quartz tungsten–halogen
(QTH) calibration lamp, a regulated power supply, an integrating sphere for uniform
illumination of the optical system and an optical table [6]. Therefore, a successful intensity
calibration requires correct system configuration, knowledge of how to perform the calibration
and some data processing.
2. METHODOLOGY
Materials
USB650 Spectrometer, Argon (A) lamp, Mercury (Neon) HgNe lamp, fiber optics accessory
with SMA adapter, Ocean view 1.4.1 software, spectral calibration wavelength location spec
sheet.
Procedure
The Argon (A) pencil lamp was inserted into the fiber optic accessory\SMA Adapter that was
connected via the fiber optic probe to a computer with plugged in USB650 spectrometer and
Oceanwave software installed. The lamp power supply was turned on to 10mA and the argon
lamp was switched on and set the exposure time to 2 minutes.
Oceanview software was configured to capture and record data. The integration time for
maximum SNR was adjusted regularly to ‘Automatic’ especially whenever there was
saturation. In order to obtain sharp and better SNR, the emission curves we not smoothened
and an average of three scans were taken. Measurements of wavelengths and intensities
produced by the Argon pencil lamp were captured and recorded. The room was kept dark
during the process in order to minimize stray light from the narrow emitted mercury ceiling
lights. The spectrometer was then interconnected to the Hg (Ne) source by the optical cable
and again measurements taken with the lamp power supply tuned on to 18mA. After which the
process was repeated for dark noise spectral measurements.
Table 1. Top 10 samples of the collected spectral data

Wavelength[nm] Hg(Ne) Argon(A) Dark Pixel


intensity intensity noise no.
350 -0.5 -1.56 -1.09 1
351 -0.01 -0.63 -2.23 2
352 0.16 0.32 -1.08 3
353 0.09 -0.2 -0.8 4
354 0.26 -1.77 0.55 5
355 0.63 0.04 0.65 6
356 0.8 0.65 -0.17 7
357 0.63 -0.75 0.42 8
358 0.54 1.28 -0.27 9
359 0.85 -0.49 -1.3 10

3. DATA PROCESSING AND ANALYSIS


As the name suggests, USB650 spectrometer provides 651 data point from minimum
wavelength of approximately 350nm to maximum wavelength of 1000 nm. These data point
corresponds to pixel number, i.e. 1 pixel corresponding to 350nm and 651 to 1000nm. The
spectral data for both the sources were plotted against their spectral emission lines.
The spectral data for Argon and HgNe line sources were combined from where the strongest
top 15 emission lines were extracted.

Figure 1. Emission lines from (a) Argon source, (b) Mercury-Neon sources, (c) Merged Argon
and Mercury-Neon source and (d) Selected top 15 emission lines for the merged Argon and
Mercury sources.
The dark noise spectrum was subtracted from the combined spectral data in order to remove and
minimize the contributions of the possible dead pixels or the stray light. The chosen spectral
lines were analyzed in terms of pixels and their respective “true wavelengths” computed using
the spectral source emission line table
Table 2. Selected data point and their respective spectral analysis

Line True USB 650 Pixel Peak Relative True


wavelength wavelength Intensity intensity wavelength
[nm] [nm] - USB650
Wavelength
1 435.835 436 88 1561.39 1558.07 -0.165
2 546.074 546 198 3256.61 3257.41 0.074
3 546.074 547 199 990.51 990.34 -0.926
4 696.543 640 292 1289.67 1289.19 56.543
5 751.765 751 403 1110.76 1110.57 0.765
6 763.51 763 415 3485.84 3486.01 0.51
7 763.51 764 416 3252.67 3252.24 -0.49
8 763.51 765 417 1339.88 1339.49 -1.49
9 772.421 772 424 1353.39 1351.3 0.421
10 772.421 773 425 978 978.97 -0.579
11 801.479 801 453 995.5 996.74 0.479
12 811.531 811 463 2512.82 2513.46 0.531
13 811.531 812 464 2050.56 2051.74 -0.469
14 842.531 842 494 1317.59 1315.2 0.531
15 912.297 912 564 1769.5 1770.68 0.297

The average of the difference between the true wavelength and USB650 wavelength was
determined using the expression
∑(True value − USB650 value)
Mean wavelength =
n
Mean wavelength = 3.7355
From table 2, the true wavelength and USB650 wavelength have a linear relationship with the
pixel number. A comparison between these wavelengths was graphically determined as shown
in Figure 2.
The correlation coefficient (r) between th
e two wavelengths and their average slop
e (∆y) was determined using a programm
ed routine
r = 0.987229248
Slope: 1.0076052

Figure 2. Comparison between the true wavelength and the USB650 wavelength.

The relationship between pixel number and wavelength was determined using an n-degree
polynomial.
The polynomial takes the form;

λ(p) = α1 p + α2 p2 + α3 p3 + ⋯ αn pn + b

where α1 , α2 , α3 … αn are coefficients, pn is the number of pixels and the superscript, n


indicating the degree of the polynomial and b the y-intercept. This was captured as a look-up
table (LUT) mapping pixel index to wavelength. Linear, quadratic and polynomial of degree
three regression models were generated to further analyze the top 15 emission line. The
coefficients of each model was determined using programmed regression routine.
The intercepts, b corresponded to the wavelength of one pixel and the coefficients had the units
of nm/pixel, nm/pixel2 and nm/pixel3 respectively.
Table 3. Summary coefficient of determination, coefficients and the intercepts of the three
models employed in regression analysis.
Model Form of the model Coefficient Coefficients Intercept
of D. (αn ) (b)
(R2 )
Linear λ(p) = αp + b 0.9872 α = 1.0076 -357.3080
model

Quadratic λ(p) = α1 p + α2 p2 + b 0.9883 α1 = 6.5821e -246.2399


model α2 = 2.625e − 04

Polynomial λ(p) = α1 p + α2 p2 + α3 p3 + b 0.9886 α1 = −4.465e − 01 -8.6016


of 3rd order α2 = −1.9150e − 03
α3 = −8.0162e − 07
Graphical representations of the three regression models

Figure 3. Regression models (a) the scatter plot, (b) the linear model, (c) the quadratic model
and (d) the 3rd order polynomial, LUT mapping pixel to wavelength.
The polynomial of degree three which take on the form,
λ(p) = α1 p + α2 p2 + α3 p3 + b
had the best prediction of the of the wavelengths with the R2 = 0.98863 = 98.8663%
Table 4. The difference between true wavelength and predicted wavelength
True Predicted True wavelength-
wavelength[nm] wavelength[nm] Predicted wavelength
435.835 445.3081 9.473066
546.074 555.3081 9.234066
546.074 556.3081 10.23407
696.543 649.3081 -47.2349
751.765 760.3081 8.543066
763.51 772.3081 8.798066
763.51 773.3081 9.798066
763.51 774.3081 10.79807
772.421 781.3081 8.887066
772.421 782.3081 9.887066
801.479 810.3081 8.829066
811.531 820.3081 8.777066
811.531 821.3081 9.777066
842.531 851.3081 8.777066
912.297 921.3081 9.011066
The average of the difference between the true wavelength and predicted wavelength was
determined using the expression
∑(True wavelength − Predicted wavelength)
Mean wavelenght =
n
Mean wavelength = 5.5726
4. CONCLUSION
USB650 spectrometer spectral calibration was performed using Argon and Mercury-Neon
emission line lamps. The best fitting results for the calibration process was determined using
regression models. Polynomial regression of degree three proved to be more accurate
compared with quadratic and linear regression models. The level of accuracy of the models
increased with the number of degrees of the polynomial. Therefore, more accurate results may
be obtained with a higher order polynomial. Some uncertainties as realized between the
predicted wavelengths and the true wavelength. This may be due to the presence of stray light
or dead pixels that affect the emission lines, non-uniform illumination system. Also the
temperature variation of the emission sources were considered in the analysis. If these factors
are considered and a uniform illumination source used in calibration process, repeatability will
be achieved.
APPENDIX
###CYRIL OTIENO.
#1. plotting the sppectral lines and top 15 points selection
import matplotlib.pyplot as plt
import pandas as pd
var = pd.read_excel("C:/Users/Cyril/Desktop/Radiomery.xlsx")
x = list(var["wave"])
y = list(var["Argon"])
p = list(var["HgNe"])
fig, ax = plt.subplots()
ax.plot(x,y,'-b')
ax.set(xlabel = "Wavelength", ylabel = "Intensity", title = "Argon Spectrum")
ax.grid()
fig1, ax1 = plt.subplots()
ax1.plot(x, p, linewidth = 1, color = "r")
ax1.set(xlabel = "Wavelength", ylabel = "Intensity", title = "HgNe Spectrum")
ax1.grid()
plt.show()
fig2, ax2 = plt.subplots()
ax2.plot(x, y, linewidth = 1, color = "r",)
ax2.plot(x, p, linewidth = 1, color = "b")
ax2.set(xlabel = "Wavelength", ylabel = "Intensity", title = "HgNe+Argon")
ax2.grid()
plt.show()
fig3, ax3 = plt.subplots()
plt.ylim(960,3700)
ax3.plot(x, y, linewidth = 1, color = "r",marker ="*", markerfacecolor = "g", markersize = 10)
ax3.plot(x, p, linewidth = 1, color = "b",marker ="*", markerfacecolor = "g", markersize = 10)
ax3.set(xlabel = "Wavelength", ylabel = "Intensity", title = "HgNe+Argon")
ax3.grid()
plt.show()

#2.
x = np.array(var["True wavelength"]).reshape((-1,1))
y = np.array(var["Pixel"])
z = np.array(var["USB 650 wavelength"])
model = LinearRegression().fit(x, y)
r_sq = model.score(x,y)
print(f"coeficient correlation:{r_sq}")
print(f"intercept:{model.intercept_}")
print(f"slope:{model.coef_}")
plt.axes(ylabel = "Wavelength[nm]", xlabel = "Pixel")
plt.grid()
plt.title("Wavelength Comparison", size = 10)
plt.plot(x, y, c ="r", linewidth = 2, linestyle = "", marker =".", markerfacecolor = "r", markersize =
20)
plt.plot(z, y,c="b", linewidth = 2, linestyle = "--", marker =".", markerfacecolor = "b", markersize =
15)
plt.show()

#3.REGRESSION CODE
####1.Linear model
from sklearn.linear_model import LinearRegression
x = np.array(var["True wavelength"]).reshape((-1,1))
y = np.array(var["Pixel"])
model = LinearRegression().fit(x, y)
r_sq = model.score(x,y)
print(f"coeficient of determination:{r_sq}")
print(f"intercept:{model.intercept_}")
print(f"slope:{model.coef_}")
print(f"coefficient: {model.coef_}")
y_pred = model.intercept_ + model.coef_* x
print(f"predicted response:\n{y_pred}")
plt.axes(ylabel = "True Wavelength[nm]", xlabel = "Pixel")
plt.grid()
plt.title("Linear Model", size = 10)
plt.scatter(y,x, c="b")
plt.plot(y_predicted,x, c="b", linewidth = 2, linestyle = "--", marker =".", markerfacecolor = "b",
markersize = 15)

"""coeficient of determination:0.9872292488619414
intercept:-357.30806635425597
slope:[1.0076052]
coefficient: [1.0076052]"""

####2.Quadratic model
from sklearn.preprocessing import PolynomialFeatures
x = np.array(var["True wavelength"]).reshape((-1,1))
y = np.array(var["Pixel"])
transformer = PolynomialFeatures(degree = 2, include_bias = False)
transformer.fit(x)
x_ = transformer.transform (x)
model = LinearRegression().fit(x_, y)
r_sq = model.score(x_,y)
print(f"coeficient of determination:{r_sq}")
print(f"intercept:{model.intercept_}")
print(f"coefficients: {model.coef_}")
y_pred = model.intercept_ + model.coef_* x
print(f"predicted response:\n{y_pred}")
plt.axes(ylabel = "True Wavelength[nm]", xlabel = "Pixel")
plt.grid()
plt.title("Quadratic Model", size = 10)
plt.scatter(y,x, c="b")
plt.plot(y_predicted,x, c="b", linewidth = 2, linestyle = "--", marker =".", markerfacecolor = "b",
markersize = 15)
plt.show()

"""coeficient of determination:0.9883917498443353
intercept:-246.23997641984965
coefficients: [6.58207821e-01 2.62572015e-04]"""

####3.polunomial of orde 3
x = np.array(var["True wavelength"]).reshape((-1,1))
y = np.array(var["Pixel"])
transformer = PolynomialFeatures(degree = 3, include_bias = False)
transformer.fit(x)
x_ = transformer.transform (x)
model = LinearRegression().fit(x_, y)
r_sq = model.score(x_,y)
print(f"coeficient of determination:{r_sq}")
print(f"coefficients: {model.coef_}")
print(f"intercept:{model.intercept_}")
y_pred = model.intercept_ + model.coef_* x
print(f"predicted response:\n{y_pred}")
plt.axes(ylabel = "True Wavelength[nm]", xlabel = "Pixel")
plt.title("3rd Order Polynomial", size = 10)
plt.grid()
plt.scatter(y,x,c = "b")
plt.plot(y_predicted,x, c="b", linewidth = 2, linestyle = "--", marker =".", markerfacecolor = "b",
markersize = 20)
plt.show()
"""coeficient of determination:0.9886328304815492
coefficients: [-4.46579929e-01 1.91513730e-03 -8.01620492e-07]
intercept:-8.601640995575451"""

REFERENCES

[1] B. C. M. M. J. &. D. C. O. Gao, "Refinement of wavelength calibrations of hyperspectral


imaging data using a spectrum-matching technique. Remote Sensing of Environment,"
Vols. 90(4),, pp. 424-433, 2004.

[2] X. S. Y. F. A. Q. W. &. L. C. Yu, "Laboratory spectral calibration and radiometric


calibration of hyper-spectral imaging spectrometer," n The 2014 2nd International
Conference on Systems and Informatics (ICSAI 2014), pp. 871-87, 2014.

[3] K. L. D. D. S. M. &. R. B. T. Richardson, "An improved calibration approach for


traveling wave ion mobility spectrometry: Robust, high-precision collision cross
sections.," Analytical Chemistry, 93(7), pp. 3542-3550, 2021.

[4] P. &. F. J. L. Oelhafen, " Accurate spectrometer calibration in electron spectroscopy.,"


Journal of Vacuum Science & Technology A: Vacuum, Surfaces, and Films, vol. 1(1), pp.
96 - 97, 1983.

[5] T. G. G. R. O. &. E. M. L. Chrien, "Accuracy of the spectral and radiometric laboratory


calibration of the Airborne Visible/Infrared Imaging Spectrometer.," Imaging
Spectroscopy of the Terrestrial Environment , Vols. Vol. 1298,, 1990.

[6] S. R. D. H. K. &. K. M. Kalidindi, " Spectral calibration of crystal plasticity models. Acta
Materialia," vol. 54(7), pp. 1795-1804, 2006.

You might also like