Initial Drift Correction and Spectral Calibration of MarSCoDe Laser-Induced Breakdown Spectroscopy on the Zhurong Rover

: The Mars Surface Composition Detector (MarSCoDe) carried by the Zhurong rover of China’s Tianwen-1 mission uses Laser-Induced Breakdown Spectroscopy (LIBS) to detect and analyze the material composition on Martian surfaces. As one extraterrestrial remote LIBS system, it is necessary to adopt effective and reliable preprocessing methods to correct the spectral drift caused by the changes in environmental conditions, to ensure the analysis accuracy of LIBS scientiﬁc data. This paper focuses on the initial spectral drift correction and estimates the accuracy of on-board wavelength calibration on the LIBS calibration target measured by the MarSCoDe LIBS. There may be two cases during the instrument launch and landing, as well as the long-term operation: (a) the initial wavelength calibration relationship can still apply to the on-board LIBS measurement; and (b) the initial wavelength calibration relationship has been changed, and a new on-board calibration is needed to establish the current relationship. An approach of matching based on global iterative registration (MGR) is presented in respect to case (a). It is also compared with the approach of particle swarm optimization (PSO) for case (b). Furthermore, their accuracy is estimated with the comparison to the National Institute of Standards and Technology (NIST) database. The experimental results show that the proposed approach can effectively correct the drift of the on-board LIBS spectrum. The the root-mean-square error (RMSE) of the internal accord accuracy for three channels is 0.292, 0.223 and 0.247 pixels, respectively, compared with the corrected Ti-alloy spectrum and the NIST database, and the RMSE of the external accord accuracy is 0.232, 0.316 and 0.229 pixels, respectively, for other samples. The overall correction accuracy of the three channels is better than one-third of the sampling interval.


Introduction
After the first Laser-Induced Breakdown Spectroscopy (LIBS) was used in an extraterrestrial environment in 2012, the ChemCam of NASA's Curiosity rover was used to investigate the Martian geochemistry [1]. In addition, as a subsequent instrument, the SuperCam of the Perseverance rover, also with LIBS, landed on 18 February 2021 [2]. In China's first Mars exploration Tianwen-1 mission, the lander taking the Zhurong rover successfully landed in the southern part of the Martian Utopian plain on 15 May 2021. As one of the six scientific payloads, the Mars Surface Composition Detector (MarSCoDe) instrument uses LIBS and Short-Wave Infrared (SWIR) spectroscopy to perform he in situ detection of the Martian surface minerals, rocks and soils [3].
LIBS technology can make use of the wavelength and intensity of the characteristic lines of elements in the laser-induced plasma spectrum produced by the ablation of samples to analyze the chemical composition of the target qualitatively and quantitatively and determine the element concentration in the sample. It is necessary to accurately identify the wavelength position of the emission lines for each element in the spectrum. The spectral line of the LIBS spectrum is not a strict geometric line. The experimental results show that these spectral lines have certain shapes, such as the Doppler broadening, the Lorentz broadening, the self-absorption broadening, Stark broadening and so on [4]. These broadening mechanisms make the spectral peaks follow Gaussian distribution or Lorentz distribution. There may be overlap between different spectral peaks, which affects our judgment of the intensity of the spectral peaks. Among them, Stark broadening not only broadens the spectral line, but also leads to the shift of the peak position [5]. The Stark broadening of the Fe I 538.34 nm emission line can be 0.01-0.06 nm for an electron density between (4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14)(15) × 10 16 cm −3 [6]. This affects the identification of elements. In addition, the change in environment or the status of the instrument also cause the position of the spectral lines to drift, which greatly reduces the accuracy of the spectral determination, especially in the extraterrestrial LIBS system. Therefore, we need to adopt suitable data-processing methods to correct the wavelength of the LIBS spectrum, improve the accuracy of the position of the characteristic spectral lines of elements, and help to distinguish the emission lines that may be overlapped.
For LIBS in the Mars environment, the main influence factor of the wavelength uncertainty comes from the environmental difference between the extraterrestrial and the Earth. The change in pressure leads to changes in the intensity of the spectral lines. From low pressure to high pressure, the intensity of the spectral lines increases at first and then decreases [7][8][9]. The change in temperature interferes with the structure of the spectrometer, thus affecting the accuracy of spectral measurement [10]. The changes in temperature and atmosphere between Mars and Earth make it possible to change the position and intensity of the characteristic spectral lines of the elements. The maximum expected drift of the ChemCam spectrometer is about three channels for a~20 • C operational temperature range. When the temperature changes greatly, it produces a larger offset [11]. The average surface temperature of the Utopian plain can change from 180 K to 240 K in a year. The temperature varies widely and is much lower than the ambient temperature of the ground laboratory. The huge environmental differences make it difficult to directly use the data model established by the laboratory to analyze the in situ exploration data on Mars. The mast unit of the ChemCam is wrapped in a protective cover to ensure that it can run in the range of −40-35 • C [12], greatly reducing the interference of the Martian ambient temperature on the instrument. The mast unit of the SuperCam has independent heaters that enable it to work at temperatures above −40 • C [13]. The Zhurong rover is powered by solar energy and does not have enough power to control the temperature of the MarSCoDe. Therefore, compared with the ChemCam and SuperCam, the MarSCoDe has to go through a more severe test of the Martian environment and adapt to the low temperature on the Martian surface. This may increase the uncertainty of the spectral wavelengths. A lot of research has been carried out to compensate the spectral wavelength drift. Carter et al., proposed a guideline of how to effectively use the polynomials commonly used in spectrometer correction software to convert the number of pixels into wavelength or wavenumber [14]. Holy analyzed the main reason for spectrometer drift and optimized the calibration equation [15]. Asimellis et al., proposed a technique of wavelength calibration based on the inverse numerical solution of the grating dispersion function, which can be used in LIBS and other spectral analyses [16]. Song et al., proposed an efficient and accurate automatic wavelength correction scheme, which improves the calibration accuracy [17]. With respect to correcting the influence of extraterrestrial environment changes on the LIBS spectrum, Wiens et al., used a partial matched filtering technique to calibrate the spectra of the ChemCam to the vacuum wavelengths in the National Institute of Standards and Technology (NIST) LIBS database and correct the wavelength drift [11]. Anderson et al., adopted an optimized ChemCam spectral calibration approach to calibrate the wavelength of the SuperCam's on-board spectrum. In addition to Ti, they also used two additional Remote Sens. 2022, 14, 5964 3 of 19 targets, one of which is a mixture of ilmenite and hematite, and the other one is a mixture of clinozoisite quartz and orthoclase [18]. Xu et al., studied the temperature-dependent trend of LIBS spectra collected by the MarSCoDe at different temperatures [19]. They selected a certain number of characteristic peaks in each of the three channels of the LIBS spectrometer. With the change in temperature, the pixel drift of each characteristic peak is roughly equal in the same channel. Wan et al., proposed an elastic particle swarm optimization (PSO) approach to fulfill the on-board spectrum calibration of the MarSCoDe [20]. Through the iteration of the particle swarm, the corresponding relationship between wavelengths and pixels is optimized. However, there may be two cases during the instrument launching and landing: (a) the initial wavelength calibration relationship (calibrated on the ground) can still apply to the on-board LIBS measurement, and there is just global drift for each of the three channels; and (b) the initial wavelength calibration relationship is changed, and a new on-board calibration is needed to find the current relationship. In addition, their performance needs further verification.
In this project, two spectral drift correction methods on the MarSCoDe LIBS are presented to deal with the two cases, respectively, and the initial LIBS spectra on the calibration target are conducted and compared. With respect to case (a), a spectrum matching based on the global iterative registration (MGR) approach is presented to identify the amount of spectral drift for each channel and correct the number of pixels, and then calculate the wavelength by the initial relationship. With respect to case (b), a PSO algorithm is verified to build the new relationship and then convert each pixel to the corresponding wavelength. Firstly, the main situation of the MarSCoDe and experimental data set are introduced. Secondly, the spectral calibration method of the LIBS spectrometer is presented. The MGR correction method is proposed for case (a) and the PSO algorithm is described for case (b). Thirdly, the spectral drift correction is carried out by a Ti-alloy calibration sample in the early detection schemes, and the internal accord accuracy is evaluated, while the calibration parameter is also conducted on another eleven calibration samples, and the external accord accuracy is evaluated. Finally, some qualitative and quantitative analysis are compared and discussed.

Previous Work Brief
The Zhurong rover left the Tianwen-1 lander and began to inspect and explore on 22 May 2021. As the main payload on-board the rover, the MarSCoDe is an instrument suite and has been described in detail in Xu et al. [19], which takes LIBS to provide an active spectroscopy over 240-850 nm, with a stand-off distance of 1.6~7 m. 1064 nm laser pulses, with the energy of about 23 mJ, at frequency of 1-3 Hz fire the sample. The LIBS spectra within the three channels were recorded using 1800 pixels of the three CCDs, and the spectrum ranges covered by channel 1 (CH-1), channel 2 (CH-2) and channel 3 (CH-3) were 240-340 nm, 340-540 nm and 540-850 nm, respectively. A set of 12 LIBS calibration samples (including Ti-alloy, norite, andesite, basalt, montmorillonite, nontronite, olivine, hypersthene, K-feldspar, gypsum, dolomite and apatite) is mounted on the antenna mast at the rear deck of the rover and about ∼1.7 m from a two-dimensional (2D) pointing mirror. Prior to the launch, we calibrated the relationship between the pixels and the wavelength using four standard lamps (including Mercury-Argon, Zinc, Cadmium and Neon), and tested the amount of spectral drift at different temperatures [19]. The main components in the calibration samples were also analyzed by X-ray fluorescence, where the main elements contain Ti, Al, Si, Fe, Mn, Mg, Ca, Na, K, O, P and S, etc. The brief workflow of the MarSCoDe LIBS in situ detection is to point the laser to the calibration sample through the 2D pointing mirror for the on-board calibration, and then point to the scientific target for the in situ detection. LIBS measurements for each scientific target or calibration sample include 60 consecutive laser shots at frequency of 3 Hz, with an integration of 1 ms and without delay after the laser shot; another 180 passive spectra without laser shots were collected with identical exposure settings and there was a dark background for each observation. Up to 21 February 2022, a total of 89 LIBS spectra on Level 2B were first released, including 51 spectra of calibration samples and 38 spectra of scientific targets.

Data Source
In each exploration scheme, the Ti-alloy is first measured and provides on-board wavelength calibration, and then two or three other calibration samples are selected to assess the real-time instrument status, before the scientific detection. We assume that the drift of the spectrum collected by MarSCoDe LIBS in one working cycle is the same. We calibrated the LIBS spectra of each calibration sample collected in the extraterrestrial environment for the first time. A total of 17 spectra were selected from the published on-board calibration data, including six spectra of Ti-alloy and 11 spectra of another eleven samples. The parameters of the LIBS data, collection time and sample name are listed in Table 1. The pressure and temperature come from the data of the Mars Climate Station on the Zhurong rover. Except for the Ti-alloy and norite samples, each spectrum is the first data of these samples measured by the MarSCoDe on Mars. According to the spectra of the calibration samples collected at different times, we selected six Ti-alloy spectra for correction. The abnormality and poor quality of the first norite LIBS spectrum may reduce the accuracy of the qualitative analysis, so we use the second scheme data of norite for the drift correction calculation. The spectrum relevance to LIBS in the Atomic Spectra Database (ASD) of NIST [21] is used as the standard to correct the on-board data. The ASD contains data for radiative transitions and energy levels in atoms and atomic ions. For a given electron temperature and electron density, the level populations and radiative transition probabilities are calculated, and then the spectrum is determined. The default values of electron temperature and electron density are 1eV and 10 17 cm −3 . The parameters are roughly set on the basis of the plasma temperature and density of the ChemCam spectrum for the validation of the proposed method [22]. We download the emission lines of nine main elements (such as Ti,  Al, Si, Fe, Mg, Ca, Na, K and O), two minor elements (Mn, P) and one trace element (S) in the 220 nm-870 nm range under vacuum conditions from the NIST database website as the standard wavelength. Some of the main characteristic peaks used in the spectral calibration approach are shown in Tables A1 and A2 in Appendix A. We do not use the wavelength values in air in the database because the Martian pressure is about 700 Pa, which is closer to a vacuum. According to the Ritz principle, the wavenumber of an emitted or absorbed photon is equal to the difference between the upper and lower energy levels. The value of wavelengths in vacuum is equal to the inverse of wavenumber, where wavenumber is in cm −1 and wavelength is in nm.
In addition, the MGR algorithm proposed in this paper selects a reference spectrum to identify the wavelength drift between the on-board spectrum and this reference spectrum, to improve the efficiency and accuracy of wavelength correction. The reference spectrum is the LIBS spectrum of the Ti-alloy sample collected by the MarSCoDe in a simulated Martian environment before the launching. The Ti-alloy is placed in a vacuum chamber filled with CO 2 at a pressure of 874 Pa and a temperature of 24 • C. The MarSCoDe was exposed to the laboratory environment and the spectrum was collected at a distance of 1.7 m from the sample.

Methodology
The conversion relationship between responded pixel and spectral wavelength is assumed, and it was determined by the spectral calibration with four standard lamps prior to launch. There are some spectral drifts with the temperature change, due to the limited temperature control of the equipment. There are two main cases: (a) the initial wavelength calibration relationship (calibrated on the ground) can still apply to the on-board LIBS measurement, which means there is just global drift for each of the three channels; and (b) the initial wavelength calibration relationship is changed through impact during launch or landing and the long-term flight environment.

The Principle of Wavelength Calibration
Spectral calibration of the spectrometer is the premise and basis for the quantitative analysis of LIBS. With respect to the wavelength calibration on the MarSCoDe LIBS spectrometer, the standard lamp with more characteristic spectral lines is used as the input signal for the spectrometer to mark the pixel position corresponding to the specific spectral line, and then the polynomial function fits the relationship between the response pixel and a given wavelength, so as to establish the conversion relationship between all the pixels and the wavelength. The appropriate characteristic spectral lines are selected so that they can evenly cover the wavelength range of each channel. Suppose the wavelength of the characteristic spectral line is λ = [λ 1 , λ 2 , λ 3 , . . . , λ n ], n denotes the number of characteristic lines, and the corresponding pixel index is P = [p 1 , p 2 , p 3 , . . . , p n ], then the pixel-wavelength relationship can be expressed as where a j is the coefficient of the polynomial and j is the order of the polynomial. In the experiment, the quadratic function is used in the three channels to describe the relationship between pixel and wavelength. The calibration coefficients in the three channels of the spectrometer are calculated in Table 2 [19].

Spectral Drift Corrected by MGR Algorithm
When the MarSCoDe works, the average temperature on Mars is −16 • C, the pressure is about 840 Pa, and the gas is mainly composed of CO 2 , including a small amount of N 2 , Ar and so on [23]. With respect to case (a), the wavelength of the characteristic lines of elements collected in the Martian environment drift to a certain extent compared with the corresponding lines in the NIST database. In addition, the relative intensity and number of characteristic lines also change, which makes it more difficult to correct the drift of on-board data.
The wavelength drift caused by temperature shows the law of overall drift in the same channel, as demonstrated in Xu et al. [19]. Based on this assumption, we propose the MGR approach for the wavelength correction of MarSCoDe LIBS. The drift situation within the channel is determined by the amount of responded pixel drift of the characteristic spectral lines, and then the drift correction of the LIBS measurements can be obtained. The drift correction of the LIBS measurements can be realized by adding a correction to the responded pixel. Through several iterations of spectral matching, the correction pixel with an optimal matching degree is selected.
In order to correct the spectral drift more conveniently and accurately, the reference spectrum is used as the bridge between the standard spectrum and the on-board data. Firstly, the drift between the reference spectrum and the standard spectrum is calculated, denoted as ∆p 1 . The reference spectra were qualitatively analyzed, and the corresponding standard spectral wavelength values of the main characteristic peaks were determined. The approximate pixel drift value of the reference spectrum can be obtained according to the sampling interval wavelength, and the reference spectrum can be moved within a certain range. At each drift, the root-mean-square error (RMSE) of the matching peak between the reference spectrum and the standard spectrum was calculated and used as the optimization standard. The correction pixel with an optimal matching degree is ∆p 2 . Secondly, the drift between the reference spectrum and the on-board spectrum is calculated, denoted as ∆p 2 . Like the calculation process of ∆p 1 , the reference spectrum is matched with the on-board Ti-alloy spectrum, and the approximate pixel drift is calculated. The on-board spectrum is moved within a certain range, and the correction pixel is selected with the optimal matching degree, namely ∆p 2 . The formula of RMSE is where λ 1i and λ 2i represent the wavelength values of the matched peaks of the two spectra to be compared, respectively, and n indicates the number of matching peaks. Finally, through the data transmission of the reference spectrum, the on-board data can be associated with the NIST database. The correction formula for wavelength drift is

Spectral Drift Corrected by Particle Swarm Optimization (PSO) Algorithm
With respect to case (b), the PSO algorithm test in Wan et al. [20] is used here to conduct the on-board calibration of MarSCoDe LIBS. The PSO algorithm is a bionic swarm intelligence algorithm proposed by American scholars Kennedy and Eberhart in 1995, inspired by the foraging behavior of birds [24]. It completes the update and optimization by searching the individual optimal solution of the particle and the global optimal solution of the particle population. For the spectrum set in each channel, a particle swarm that contains several particles is set up. Each particle moves freely in the solution space. The position of the particle represents the coefficient in Formula (1). Bringing it into Formula (1), the new spectral coordinates are obtained and recorded as the particle wavelength set (PWS). The RMSEs of the matching peaks between the PWS and the standard spectrum are calculated. After many iterations, the particle position with the minimum error, that is, the optimal wavelength calibration coefficient, is calculated.

Comparison and Evaluation
Based on the wavelength values in the NIST database, the on-board data are corrected by MGR and PSO. In order to verify the accuracy and reliability of the calibration approach, the calibration results are evaluated from two aspects: internal accord accuracy and external accord accuracy. In the internal accord accuracy, the corrected parameter of the Ti-alloy spectrum is first determined by the correction approach and referencing the NIST wavelength, and then used for the drift correction of this spectrum; the wavelength accuracy of the characteristic lines in the corrected spectrum is compared to the NIST database. In the external accord accuracy, the corrected parameter is used to correct the spectrum of the other 11 calibration samples, and then the wavelength accuracy of the characteristic lines is compared to the elemental spectral lines in the samples from the NIST database. Referencing the NIST database, the indicators of absolute mean error (AME) and RMSE on the corrected spectra are used to quantitatively analyze the correction accuracy.

The Results of MGR Algorithm
In the calculation of ∆p 1 , the reference spectrum is preprocessed, including dark background subtraction, noise filtering, cubic spline interpolation fitting and min-max normalization. According to the initial wavelength calibration coefficient in Table 2, the initial wavelength sampling intervals of the three channels are 0.0667 nm, 0.1324 nm and 0.2033 nm, respectively. Figure 1 shows the variation in RMSE obtained by moving the reference spectrum each time. It can be obviously observed that the RMSE shows a parabolic trend with the change in the number of corrected pixels. The abscissa corresponding to the minimum RMSE is the drift of the reference spectrum with respect to the standard spectrum. The spectral drift correction amounts of the three channels are 1.40, 1.39 and 0.45 pixels, respectively, with an RMSE of 0.0258, 0.0362 and 0.0550 nm, respectively. In the calculation of Δ 2 , the on-board spectra need to be preprocessed in the same way as the reference spectra. The published on-board data have been subject to dark background subtraction and radiation calibration, so we only need to perform cubic spline interpolation fitting and min-max normalization on the on-board spectrum. The spectra of the Ti-alloy collected by MarSCoDe LIBS on different Martian days are compared with the reference spectrum after the same processing. Taking the Ti-alloy spectrum collected on 25 June 2021 as an example, Figure 2 shows the changes in the spectrum before and after correction and the change diagram of the RMSE. The length of both the reference spectrum and the on-board spectrum is 5400 pixels, so the position of the peak position in calculation is the pixel rather than the wavelength when the peaks are matched. The RMSE is also measured in pixels. As can be seen from Figure 2, the matching peaks in each channel are distributed as evenly as possible. The corrected spectrum is in good agreement with the reference spectrum. The change in RMSE is also a parabola trend. The position In the calculation of ∆p 2 , the on-board spectra need to be preprocessed in the same way as the reference spectra. The published on-board data have been subject to dark background subtraction and radiation calibration, so we only need to perform cubic spline interpolation fitting and min-max normalization on the on-board spectrum. The spectra of the Ti-alloy collected by MarSCoDe LIBS on different Martian days are compared with the reference spectrum after the same processing. Taking the Ti-alloy spectrum collected on 25 June 2021 as an example, Figure 2 shows the changes in the spectrum before and after correction and the change diagram of the RMSE. The length of both the reference Remote Sens. 2022, 14, 5964 8 of 19 spectrum and the on-board spectrum is 5400 pixels, so the position of the peak position in calculation is the pixel rather than the wavelength when the peaks are matched. The RMSE is also measured in pixels. As can be seen from Figure 2, the matching peaks in each channel are distributed as evenly as possible. The corrected spectrum is in good agreement with the reference spectrum. The change in RMSE is also a parabola trend. The position of the minimum RMSE is the best correction amount. Table 3 shows the ∆p 2 and RMSE of six Ti-alloy spectra. The mean RMSE for the three channels is 0.138, 0.119 and 0.163 pixels, respectively. The RMSEs of all three channels are better than 0.2 pixels. The corrections of the Ti-alloy spectra collected at different times are different. This has to do with the different environment and instrument states at each probe. The drift of the first channel and the second channel is small, and the drift of the third channel is the largest.
way as the reference spectra. The published on-board data have been subject to dark background subtraction and radiation calibration, so we only need to perform cubic spline interpolation fitting and min-max normalization on the on-board spectrum. The spectra of the Ti-alloy collected by MarSCoDe LIBS on different Martian days are compared with the reference spectrum after the same processing. Taking the Ti-alloy spectrum collected on 25 June 2021 as an example, Figure 2 shows the changes in the spectrum before and after correction and the change diagram of the RMSE. The length of both the reference spectrum and the on-board spectrum is 5400 pixels, so the position of the peak position in calculation is the pixel rather than the wavelength when the peaks are matched. The RMSE is also measured in pixels. As can be seen from Figure 2, the matching peaks in each channel are distributed as evenly as possible. The corrected spectrum is in good agreement with the reference spectrum. The change in RMSE is also a parabola trend. The position of the minimum RMSE is the best correction amount. Table 3 shows the Δ 2 and RMSE of six Ti-alloy spectra. The mean RMSE for the three channels is 0.138, 0.119 and 0.163 pixels, respectively. The RMSEs of all three channels are better than 0.2 pixels. The corrections of the Ti-alloy spectra collected at different times are different. This has to do with the different environment and instrument states at each probe. The drift of the first channel and the second channel is small, and the drift of the third channel is the largest. On-board spectra before and after drift correction using the reference spectrum as a reference. The reference spectrum is the spectrum of the Ti-alloy collected by the MarSCoDe in a simulated Martian environment before launch. (a-c) show the three channels' spectra of the on-board Ti-alloy before and after ∆p 2 correction and corresponding reference spectrum. The position of the matching peaks is circled. The spectrum intensity is offset for clarity. (d-f) show the RMSE change diagram of the on-board spectrum during the translation iterative. The spectrum was collected by the MarSCoDe on 25 June 2021.

The Results of PSO Algorithm
We use the PSO algorithm to correct the drift of on-board Ti-alloy spectra and obtain the new relationship between the responded pixel and wavelength. The on-board spectrum is performed by cubic spline interpolation fitting and min-max normalization before correction. The wavelength calibration coefficient after correction is shown in Ti-alloy spectrum collected on 25 June 2021 as an example, Figure 3 shows the change in RMSE with the number of iterations during the iteration process. In the previous iterative calculation, the matching error decreased rapidly. With the increase in the number of iterations, the rate of error reduction becomes slower and slower, which indicates that it is close to the optimal solution.

Internal Accord Accuracy
Referencing the NIST database, the total wavelength drift of the on-board Ti-alloy spectrum obtained by the MGR method is shown in Table 5. The drift of the spectrum is different at different times. For example, in the spectrum set of CH-1, the minimum drift is only 0.24 pixels, and the maximum drift is 4.04 pixels; in the spectrum set of CH-2, the

Internal Accord Accuracy
Referencing the NIST database, the total wavelength drift of the on-board Ti-alloy spectrum obtained by the MGR method is shown in Table 5. The drift of the spectrum is different at different times. For example, in the spectrum set of CH-1, the minimum drift is only 0.24 pixels, and the maximum drift is 4.04 pixels; in the spectrum set of CH-2, the minimum drift is only 1.43 pixels, and the maximum drift is 3.91 pixels; and in the CH-3, the minimum drift is only 12.72 pixels, and the maximum drift is 12.97 pixels. This is related to the changes in environment on Mars. As can be seen from Table 1, the temperature and air pressure are different every day. We carry ∆p 1 and ∆p 2 into Equation (3) to obtain the corrected on-board spectral wavelength. Table 6 shows the AME and RMSE of two different spectral wavelength drift correction approaches. For the accuracy of MGR, the mean errors in the first, second and third channel is 0.016 nm, 0.022 nm and 0.040 nm, and the RMSE is 0.020 nm, 0.030 nm and 0.050 nm, respectively. According to the sampling interval wavelength value corresponding to each pixel, the mean error is 0.232 pixels, 0.166 pixels and 0.195 pixels, and the RMSE is 0.292 pixels, 0.223 pixels and 0.247 pixel, respectively. Furthermore, the maximum error is 29.2% of the pixel (on the RMSE of CH-1), so that the overall accuracy is better than one-third of the pixel. For the accuracy of the PSO, the mean error in the first, second and third channel is 0.017 nm, 0.031 nm and 0.021 nm, and the RMSE is 0.023 nm, 0.039 nm and 0.026 nm, respectively. According to the sampling interval wavelength value corresponding to each pixel, the mean error is 0.255 pixels, 0.230 pixels and 0.104 pixels, and the RMSE is 0.342 pixels, 0.291 pixels and 0.104 pixels, respectively. In addition, the maximum error is 34.2% of the pixel (on the RMSE of CH-1), so that the overall accuracy is nearly one-third of the pixel. The errors may come from the limitation of spectral resolution, which makes it impossible for us to accurately determine the position of the spectral peaks. In addition, Stark broadening is also one of the important factors affecting the correction effect. The collision of atoms with ions and electrons shifts the position of the spectral peak. Since the spectral resolution of the three channels of the MarSCoDe is nearly 0.19 nm, 0.31 nm and 0.45 nm, respectively, which is much higher than the shift range of spectral lines caused by Stark broadening, in this study, we ignore the influence of spectral line drift caused by Stark broadening and focus on the spectral drift caused by environmental changes. We do not analyze the Stark shift of the spectrum, which may be one of the sources of the final error. It should also be noted that, in this paper, we assume that the MarSCoDe LIBS spectrum satisfies the local thermal equilibrium, which is consistent with the data in the NIST database. However, we do not have strong data to support this hypothesis. This may also be one of the sources of error. From the results of the RMSE, the effect of the MGR method is better than that of the PSO algorithm in the first and second channel, and slightly inferior to the PSO method in the third channel. This may be due to the low resolution of the third channel spectrometer. The uncertainty of the position of the characteristic peaks makes the fitting calibration relationship more accurate. In Table 5, the number of matching peaks selected by the MGR and PSO methods for spectral correction is counted. Due to the change in environment, the intensity value of the Ti-alloy spectrum collected at different times changes, and the number of characteristic peaks is also different. As many characteristic peaks as possible were selected in each channel for spectral correction and accuracy evaluation. Taking the Ti-alloy spectrum collected on 12 July 2021 as an example, Figure 4 shows the spectra before and after wavelength drift correction by the MGR and PSO methods. As can be seen from the figure, the number of characteristic lines in the third channel is much smaller than that in the first and second channels. After correction, the two methods can solve the problem of spectral drift well.

External Accord Accuracy
The correction amount or correction coefficient obtained from the Ti-alloy spectrum is carried into other samples' spectra to realize the drift correction. We used MGR and PSO approaches to correct the spectra of another 11 calibration samples and calculated the mean error and RMSE of the matching peaks, as shown in Table 7. For the accuracy of MGR, the mean errors in the first, second and third channel is 0.012 nm, 0.033 nm and 0.040 nm, and the RMSE is 0.015 nm, 0.042 nm and 0.0460 nm, respectively. According to the sampling interval wavelength value corresponding to each pixel, the mean error is 0.183 pixels, 0.253 pixels and 0.195 pixels, and the RMSE is 0.232 pixels, 0.316 pixels and 0.229 pixels, respectively. Furthermore, the maximum error is 31.6% of the pixel (on the RMSE of CH-2), so that the overall accuracy is also better than one-third of the pixel. For the accuracy of the PSO, the mean error in the first, second and third channel is 0.012 nm, 0.040 nm and 0.052 nm, and the RMSE is 0.017 nm, 0.047 nm and 0.066 nm, respectively. According to the sampling interval wavelength value corresponding to each pixel, the mean errors is 0.179 pixels, 0.305 pixels and 0.254 pixels, and the RMSE is 0.251 pixels, 0.357 pixels and 0.326 pixels, respectively. In addition, the maximum error is 35.7% of the pixel (on the RMSE of CH-2), so that the overall accuracy is also nearly one-third of the pixel. Using RMSE as the evaluation mechanism of the correction approach, the effects of the two methods are almost the same in the first channel. The MGR correction results of individual samples are better, such as Andesite, Montmorillonite and Hypersthene. In the second and third channels, the RMSE of most samples of the MGR algorithm is lower, which shows that its correction effect is better than that of the PSO algorithm. The MGR algorithm is more universal and can be applied to the spectral correction of different samples. Figure 5 shows the on-board spectra of 11 samples before and after wavelength drift correction. The spectra corrected by the two approaches match the NIST database well. Many elements such as Mg, Si, K, Ca, Na, O and C can be identified. Table 7 counts the number of characteristic lines used in the calibration process of the on-board spectra. In some samples, such as gypsum, the number of characteristic peaks is small, but they are uniformly distributed throughout the wavelength range of the spectrometer.
Remote Sens. 2022, 14, x FOR PEER REVIEW 12 of 19 Figure 4. The spectrum of on-board Ti-alloy before and after wavelength drift correction using the MGR approach and PSO approach. (a-c) represent the spectrum in the CH-1, CH-2 and CH-3, respectively. (d-f) are the local spectra in the three channels, respectively. The spectrum intensity is offset for clarity.

External Accord Accuracy
The correction amount or correction coefficient obtained from the Ti-alloy spectrum is carried into other samples' spectra to realize the drift correction. We used MGR and PSO approaches to correct the spectra of another 11 calibration samples and calculated the mean error and RMSE of the matching peaks, as shown in Table 7. For the accuracy of MGR, the mean errors in the first, second and third channel is 0.012 nm, 0.033 nm and 0.040 nm, and the RMSE is 0.015 nm, 0.042 nm and 0.0460 nm, respectively. According to the sampling interval wavelength value corresponding to each pixel, the mean error is 0.183 pixels, 0.253 pixels and 0.195 pixels, and the RMSE is 0.232 pixels, 0.316 pixels and 0.229 pixels, respectively. Furthermore, the maximum error is 31.6% of the pixel (on the RMSE of CH-2), so that the overall accuracy is also better than one-third of the pixel. For the accuracy of the PSO, the mean error in the first, second and third channel is 0.012 nm, 0.040 nm and 0.052 nm, and the RMSE is 0.017 nm, 0.047 nm and 0.066 nm, respectively. According to the sampling interval wavelength value corresponding to each pixel, the mean errors is 0.179 pixels, 0.305 pixels and 0.254 pixels, and the RMSE is 0.251 pixels, 0.357 pixels and 0.326 pixels, respectively. In addition, the maximum error is 35.7% of the pixel (on the RMSE of CH-2), so that the overall accuracy is also nearly one-third of the pixel. Using RMSE as the evaluation mechanism of the correction approach, the effects of the two methods are almost the same in the first channel. The MGR correction results of individual samples are better, such as Andesite, Montmorillonite and Hypersthene. In the second and third channels, the RMSE of most samples of the MGR algorithm is lower, which shows that its correction effect is better than that of the PSO algorithm. The MGR algorithm is more universal and can be applied to the spectral correction of different sam- Figure 4. The spectrum of on-board Ti-alloy before and after wavelength drift correction using the MGR approach and PSO approach. (a-c) represent the spectrum in the CH-1, CH-2 and CH-3, respectively. (d-f) are the local spectra in the three channels, respectively. The spectrum intensity is offset for clarity. Table 7. The absolute mean error (AME) and RMSE of corrected on-board spectra and the number of characteristic peaks used in the spectral correction of each channel. In the table, "Number" represents the number of characteristic peaks.

Sample
Correction Method CH-1 CH-2 CH-3   Figure 5. The before and after drift correction spectra of 11 calibration samples obtained by using MGR and PSO. (A) is the spectrum in the three channels, and (B) is the local spectrum. The vertical dashed lines represent the standard spectra. The blue lines represent the spectra corrected by the MGR method. The orange lines represent the spectra corrected by the PSO method. The red lines represent the uncorrected on-board spectra. The spectrum intensity is offset for clarity.

Conclusions
As one extraterrestrial LIBS system, MarSCoDe LIBS also has some spectral drift with the changes in the environmental conditions. Elaborate LIBS spectral calibration is the crucial foundation for realizing accurate qualitative and quantitative analysis, even for sophisticated deep learning based chemometrics [25,26]. There may be two cases during the instrument launch and landing, as well as the long-term operation: (a) the initial wavelength calibration relationship can still apply to the on-board LIBS measurement; and (b) the initial wavelength calibration relationship is changed, and a new on-board calibration is needed to find the current relationship.
In this project, two spectral drift correction approaches of MGR and PSO are presented to deal with the two cases, respectively, and the initial on-board LIBS spectra of the LIBS calibration targets are conducted and compared. Firstly, the main situation of the MarSCoDe and the experimental data are introduced. Secondly, the spectral calibration approach of the LIBS spectrometer is presented. The MGR correction method is proposed for case (a), and the PSO algorithm is described for case (b). Thirdly, the spectral drift correction is carried out using the Ti-alloy calibration sample, and the internal accord accuracy is evaluated, while the calibration parameter is also conducted on other calibration samples, and the external accord accuracy is evaluated. Finally, some qualitative and quantitative analyses are estimated with a comparison to the NIST database. The experimental results show that the proposed approach can effectively correct the drift of the on-board LIBS spectrum, and the RMSE of the internal accord accuracy for the three channels is about 0.292, 0.223 and 0.247 pixels, respectively, compared with the corrected spectrum and the NIST database, and the RMSE of the external accord accuracy is about 0.232, 0.316 and 0.229 pixels, respectively. The overall accuracy of the three channels is better than one-third of sampling interval. Compared with the PSO method, MGR has a better correction effect in the first and second channels. The correction effect of MGR in the third channel is worse, which may be caused by the low spectral resolution in the third channel. When the calibration model obtained from the Ti-alloy spectrum is tested in the spectra of other calibration samples, the MGR method performed better than the PSO method in the three channels. The maximum internal accord accuracy errors of the MGR and PSO methods are about 29.2% and 34.2% of pixels, respectively (on the RMSE of CH-1). The maximum external accord accuracy errors of the MGR and PSO methods are about 31.6% and 35.7% of pixels, respectively (on the RMSE of CH-2). The internal and external accord accuracy of MGR is higher.  Data Availability Statement: The data are available upon request from the author.

Conflicts of Interest:
The authors declare no conflict of interest.