Spectrometer Wavelength Calibration: Theory

James Graham

The wavelength solution for a spectrometer is established by observing a source with known monochromatic wavelengths, e.g., cold cathode Ne and Ar discharge lamps, and measuring the pixel position of the resultant lines on the sensor array. In this example we use both neon and argon lines. For a grating-based spectrometer we derive this relationship and show why the commonly adopted polynomial approximation provides a suitable wavelength solution. The degree of the polynomial adopted is not known a priori. Here we propose a method to make this choice. As a concrete example we will work through the wavelength calibration of an Ocean Optics USB2000 compact spectrometer.

The USB2000 Spectrometer

The USB2000 spectrometer is based on a diffraction grating and a one-dimensional CCD detector array of 2048 pixels. Light enters via a slit located at the end of a threaded receptacle, which can be used to connect to a multimode optical fiber that is terminated with a SMA 905 connector. This instrument achieves a spectral resolution of about 0.6 nm between wavelengths of 350 to 660 nm. The spectrograph is based on a Czerny-Turner optical design and has no moving parts.

Property Value
Model USB 2000
Grating 1200 mm\(^{-1}\) holographic grating
Bandwidth 350-660 nm
Options L2 lens, 25 mm slit, WG305 filter
CCD Sony ILX411; 2048 pixels; 14 \(\mu\)m\(\times\)200 \(\mu\)m
Focal lengths 42 mm collimator; 68 mm camera

The optical layout of the USB2000 is shown schematically below.

Schematic of the interior layout of the USB2000 spectrometer.

Light enters via the SMA fiber receptacle. The light diverges and fills a cone defined by the numerical aperture of the fiber. The light is collected by the collimator mirror. The collimator illuminates the grating with parallel light, where it is diffracted, with longer wavelength light emerging at a larger angle than shorter wavelengths. These rays are imaged by the camera mirror, which relays rays at different angles of diffraction onto different locations on the CCD sensor.

The function of the collimator, grating, and camera are clearer in a simplified ray diagram, where we have replaced the mirrors with lenses and the reflection grating by a transmission grating.

Ray diagram for the USB2000 replacing mirrors with thin lenses

The basic function of the optical layout shown above is to make an image of the entrance slit on the CCD array. The slit and the CCD are placed one focal length from the collimator and camera, respectively, so that light between the two is parallel or collimated. With no grating in the optical path, all wavelengths would come to a focus at a single point on the optical axis. However, the grating introduces a angular deflection so that the position of the image depends on the wavelength. The spectrometer makes monochromatic images of the slit with position that depends on wavelength. Thus, the spectrometer encodes wavelength as position. As the slit has finite width, the ability of a slit spectrometer to separate two wavelength (spectral resolving power) depends on the width of the slit.

Mapping Between Wavelength and Position

To understand the basis of wavelength calibration we need to understand the relationship between the location of the image of the entrance slit on the CCD and wavelength. The grating equation (Eq. 1) determines the angle of diffraction, \( \beta \), relative to the grating normal. If \( \lambda \) is the wavelength under consideration and \( \sigma\) is the grating groove spacing, then the condition for constructive interference requires that \[ m \lambda /\sigma = \sin \alpha + \sin \beta , \tag{1} \] where we have assumed a 2-d geometry in which the light that is incident at an angle \( \alpha \) relative to the grating normal lies in the plane perpendicular to the grooves on the grating.

Mapping between angle of diffraction and pixel

By considering the camera as an ideal thin lens we can see from the sketch above that \( \beta\) fixes the position of the image on the CCD array at wavelength \( \lambda\).

In the general case where the grating normal and the optical axis of the camera are not parallel, a ray passing through the center of the camera lens, focal length, \(f_{cam}\), at angle \( \beta \) intersecs the image plane at a point \[ p = p_0 + f_{cam} \tan (\beta-\beta_0) , \tag{2} \] where \( \beta_0\) is the angle between the grating normal and the camera optical axis and \(p_0 \) is a reference pixel where the wavelength is \( \lambda_0\). Using the grating equation for \( \beta \), the full relation between \(p\) and \( \lambda \) is

\[ p = p_0 + f_{cam} \tan \left[ \arcsin \left( m\lambda/\sigma -\sin \alpha \right)-\beta_0 \right] \tag{3} .\]

Wavelength Solution Using the Grating Equation

For our USB spectometer we know the pixel size of the Sony ILX511 CCD (14 \(\mu\)m), the groove density of the grating (\(1/\sigma = \) 1200 mm\(^{-1}\)), and the order of diffraction (\(m\) = 1) in Eq. (3). We should be able to use the measurements of line positions to make a least squares estimate of the remaining four parameters and therefore the wavelength of any pixel in the array.

Best fit wavelength solution using Eq. (3). The lines shortward of 600 nm are predominantly Hg I and Ar I. The lines longword of 600 nm are predominantly Ne I. 

At first sight, Eq. (3) does a good job describing the measurement of line positions. The non-linearity evident in the data (blue points) seems to be nicely matched by upward curvature of the model (red line). However, it is always good practice to plot the residuals or the difference between the observed and predicted values. This allows us to focus on the discrepancy between the data and the model and highlight any systematic trends.

Difference between the observed and computed position as a function of wavelength using a least squares fit with Eq. (3). The residuals reveal a distinctive cubic term missing from the fit.

This figure shows a systemic pattern with errors as large as 2.6 pixels or 0.4 nm. The fidelity of Eq. (3) could be improved to achieve smaller residuals and a more precise and accurate wavelength calibration. For example, the camera suffers from optical distortion because \(f_{cam}\) is not constant, but depends on field angle. A more expedient solution, an empirical polynomial solution: \[ p = p_0 + p_1 \lambda + p_2 \lambda^2 + p_3 \lambda^3 + ... , \tag{4}\] is typically adopted by manufacturers.

Polynomial Wavelength Solution

A polynomial wavelength solution is justified by making a Taylor expansion of Eq. (3) about some wavelength, \( \lambda_0\) , which yields

\[\begin{eqnarray} p & = & p_0 + f_{cam} \frac{m}{\sigma \cos \beta_0 } (\lambda - \lambda_0) \\ & + & f_{cam} \frac{m^2 \tan \beta_0}{2\sigma^2 \cos^2\beta_0} (\lambda - \lambda_0)^2 \\ & + & f_{cam} \frac{m^3 }{2\sigma^3 \cos^5\beta_0} (\lambda - \lambda_0)^3 \\ &+& O\left( (\lambda - \lambda_0)^4 \right). \tag{5} \end{eqnarray}\]

A polynomial wavelength solution (Eq. 4) and a Taylor series expansion (Eq. 5) are functionally equivalent, justifying common practice. Both odd and even powers are present in the expansion, so no terms can be dropped. The coefficients are not independent, but this information is discarded when a polynomial solution is adopted. In principle a series in powers of \( (\lambda - \lambda_0)\) is preferable because of the potential to exceed the largest floating point values if 32-bit representation is used. This approach provides no guidance on where to terminate the series.

Choosing the Order of the Polynomial

Examining the residuals or difference between the observed line position, \(p_i\), and the predicted one, \( p(\lambda_i)\), based on a polynomical fit provides a practical way of establishing the order of fit to use. It is necessary to use the lowest order consistent with the uncertainties in the position measurements because a polynomial of sufficently high order will pass through every point and amplify the noise in the wavelength solution.

If the uncertainty in each line position measurment \( \sigma_i\) is known then the \(\chi_n ^2\) statistic,

\[ \chi_n^2 = \frac{1}{n}\sum_{i=1}^n \frac{ \left(p_i - p(\lambda_i)\right)^2 } {\sigma_i^2} \]

can be used to assess the quality of the fit. The rule of thumb is when \( \chi_n^2 =1 \), the fit is adequate.

Often the measurement errors are not well known. But the quality of the fit can be examined by plotting the residuals and computing the RMS, \[ RMS = \sqrt{\frac{1}{n-m-1}\sum_{i=1}^n \left(p_i - p(\lambda_i)\right)^2 } , \] where \( m\) is the order of the polynomial.

Difference between the observed and computed line position vs. wavelength for least-squares polynomial wavelength solutions (Eq. 4). The results for linear, quadratic, cubic, quartic, and quintic fits are displayed. Each plot is labeled with the RMS residual.
The linear fit shows a residual with a predominantly parabolic shape. The quadratic fit accounts for this departure, but leaves an S-shaped cubic residual, which in turn is removed by the next higher order fit. At each step the RMS drops: from 23 to 2.3 to 0.5 and then to 0.1 pixels for the quartic polynomial. The final panel shows that no improvement is achieved going from a quartic to a quintic polynomial. Adding higher order terms would just fit the noise in the data,  so the quartic fit is preferred.

 

© Eikonal Optics