# Robust Full-Screen Wavelength Calibration Algorithm
## Appendix A
### A Rough Calibration  
Given the feedback value specified by the lower computer, the scanning motor is rotated until it reaches to the feedback value. At this time, we observe the spectral signal of the linear array CCD in the upper computer. If the spectral signal appears at the central pixel, we can record the wavelength and the corresponding feedback value. Unfortunately, we do not know what the feedback value of the central pixel is for the spectral signal we want to observe. If manually specify the feedback value of the lower computer and then find the spectral signal by rotating the motor, the data-collecting process will be very time-consuming. Due to this fact, we employ a rough calibration strategy first. After obtaining the approximate value near the feedback value for the given wavelength by the rough calibration, the exact feedback value can be easily found manually. In comparison to the former procedure, this data-collecting method saves a large amount of time and labor.  
A set of gratings with the same line pairs were selected for double-layer secondary diffraction. The wavelength standard 1 used for calibration is a 253.65 nm laser with a calibrated wavelength, and the wavelength standard 2 is a 632.81 nm laser with a calibrated wavelength. In the experimental process, we first start the scanning motor to slide the slider in the raster scanning machine to the mechanical zero position. At this time, we open calibrated wavelength standard 1. The light emitted by it will be vertically incident to the optical inlet of the spectrometer. Then, the grating scanning machine begins to scan until the upper machine display that the spectral signal of the line array detector appears at the central pixel. At present, we register the reading head number \(x_{01}\), the wavelength \(\lambda_{01}\), and close the wavelength standard 1. Next, we turn on the wavelength standard 2 and repeat the same process to obtain another data pair \((x_{02},\lambda_{02})\). With \((x_{01},\lambda_{01})\) and \((x_{02},\lambda_{02})\), we can find a linear equation  
\[\lambda_{0}=k_{0}x+a_{0}, \tag{1}\]  
where \(k_{0}\) and \(a_{0}\) are the slope and intercept of the straight line. The role of Equation (1) is to rough calibrate the spectrometer so that the scanning motor could be used to turn to the vicinity of the grating diffraction wavelength which needs to be calibrated. Based on this equation, more data pairs of the feedback value and grating diffraction wavelength can be easily obtained to facilitate the later precise calibration.  
To implement accurate calibration, we need more feedback value and wavelength data pairs which can be obtained with the following method. First, two wavelength standards are used to perform the coarse labeling of Equation (1). Then Equation (1) is used to find the approximation of the feedback value corresponding to the standard wavelength given the other wavelength standards. Finally, the lower computer is used to rotate the scanning motor until the upper computer shows that the standard wavelength signal ofthe linear array CCD appears at the central pixel. We will record such a data pair (\(x_{c}\), \(\lambda_{c}\)). Suppose that we totally obtain \(n\) data pairs (\(x_{c}^{1},\lambda_{c}^{1}\)), \(\cdots,(x_{c}^{n},\lambda_{c}^{n}\)) here.