# Robust Full-Screen Wavelength Calibration Algorithm
## 4 Experimental Studies
### Simulated Experiments  
We used wavelength standards 1 and 2 to record the standard wavelength (\(x_{01}\), \(x_{02}\)) and its reading head number (\(\lambda_{01}\), \(\lambda_{02}\)) at the central pixels. Using (\(x_{01}\), \(\lambda_{01}\)) and (\(x_{02}\), \(\lambda_{02}\)), we can fit Equation (4) using rough calibration, as described in Appendix A.1. According to Equation (4), the feedback values \(x_{10}\), \(x_{20}\), \(x_{30}\), \(x_{40}\), \(x_{50}\), \(x_{60}\), \(x_{70}\), \(x_{80}\) of the grating ruler were calculated when the characteristic wavelengths of the mercury lamp were 253.65 nm, 312.57 nm, 365.02 nm, 404.66 nm, 435.84 nm, 546.07 nm, 576.96 nm, and 570.07 nm, respectively. Using the above data pairs, the scanning motor pulse was set so that each feature spectrum scanned to the central pixel of the linear-array CCD. In this way, accurate test results \(x_{11}\), \(x_{21}\), \(x_{31}\), \(x_{41}\), \(x_{51}\), \(x_{61}\), \(x_{71}\), \(x_{81}\) could be obtained from the feedback values of the grating ruler. With (\(x_{11},253.65\)), (\(x_{21},312.57\)),(\(x_{31},365.02\)),(\(x_{41},404.66\)), (\(x_{51},435.84\)), (\(x_{61},546.07\)), (\(x_{71},576.96\)), (\(x_{81},570.07\)), we conducted experiments to verify the performance of the central pixel wavelength calibration algorithm (i.e., Algorithm 1). Specifically, the nonlinear least square method under LMA was used for calculation, and its parameters were initialized, as shown in Table 1, where \(\lambda_{c}\) is the characteristic wavelength of the mercury lamp and \(freq\) is a given frequency. The reasons the initial values were set in this way, such as the limited space, are explained in Appendix A.3. Figure 3 shows the sinusoidal curve fitted by Algorithm 1; the fitted parameters are shown in Table 2. In Figure 3, the horizontal axis indicates the wavelength and the vertical axis is the feedback value. The fitting performance is good, as the known wavelengths and feedback values are fitted very well. By calculation, the maximum difference between the original data and the fitted sinusoidal function was shown to be 0.03365 nm. Next, we simulated some experimental data to validate the performance of the calibration algorithm at non-central pixels. We turned on the mercury lamp and let the light from the mercury lamp that was vertically incident on the light inlet of the spectrometer. The scanning motor was started to rotate the raster scanning machine to 0 nm, and then the raster scanning machine was started. According to the pixel number of linear-array CCD (take \(2048\times 1\) linear-array CCD as an example), the average value \(x_{1}\), \(x_{256}\), \(x_{512}\), \(x_{768}\), \(x_{1280}\), \(x_{1536}\), \(x_{1792}\), \(x_{2048}\) (denoted as \(X\)) of the feedback value of the grating ruler corresponding to the feature peak at \(p_{1}\)(the first pixel), \(p_{256}\), \(p_{512}\), \(p_{768}\), \(p_{1280}\), \(p_{1536}\), \(p_{1792}\), and \(p_{2048}\) (denoted as \(P\)) of a certain feature peak were recorded. In a similar way, we also recorded the feedback values \(X\) that correspond to the characteristic peaks in the mercury lamp 253.65 nm, 312.57 nm, 365.02 nm, 404.66 nm, 435.84 nm, 546.07 nm, 576.96 nm, 570.07 nm. Based on these data, we used Algorithm 2 to test its performance. According to Algorithm 2, We selected the initial step size \(Ir_{0}\), the initial weight \(\beta_{0}\), the hyperparameter \(\eta\), and the \(E\) values within a certain range. The initial step size \(Ir_{0}\) and the hyperparameter \(\eta\) were selected from \(\{0.01,0.001,0.0001\}\). The selection range of the initial weight \(\beta_{0}\) was one of the intervals from \(\{(-0.1,-0.1),(0,0),(0.1,0.1)\}\). The candidate values of the epoch number \(E\) were set as \(\{100,150,200\}\). The final hyperparameter configuration, obtained after conducting some preliminary analyses with different combinations of these hyperparameters, is shown in Table 3.