## 2 Materials and Methods
### Data Preprocessing
#### 2.3.3 Enhanced SG Filtering  
The SG filtering method is nearly fully automatic and only needs a few input parameters. It has been proven to be flexible and time-efficient. Its fitting index assures that the fitted time series has a low deviation from the original time series. In Equation (6), \(Y\) is the original time series value, \(N\) is the number of convoluting integers and is equal to the smoothing window size (\(2\ m+1\)), and \(C_{i}\) is the coefficient for the ith value of the filter (smoothing window), which can be calculated from the equations presented by [PERSON] [45].  
\[Y_{j}{}^{*}=\frac{\sum_{i=-m}^{i=m}C_{i}Y_{j+1}}{N}, \tag{6}\]  
Figure 4: Trend-fill method.  
Figure 3: Gap-filling method. Solid time series points represent known time series values, and hollow time series points represent missing time series values.  
Enhanced SG filtering methods are designed separately for time series of NDVI and other data, such as GPP and LAI. For NDVI time-series data, only smoothed points with values greater than the original value can be accepted as the upper boundary of NDVI. However, for other time-series datasets, some high values cannot be accepted and the NDVI smoothing strategy is not appropriate.  
The strategy for NDVI aims to obtain the upper envelope of the time series values, as per Equation (7) [26]:  
\[N_{i}^{1}=\langle\begin{array}{cc}N_{i}^{0}&when&N_{i}^{0}\geq N_{i}^{tr}\\ N_{i}^{tr}&when&N_{i}^{0}\leq N_{i}^{tr}\end{array} \tag{7}\]  
\[F_{k}=\sum_{1}^{n}(\left|N_{i}^{k+1}-N_{i}^{0}\right|\times W_{i})\ W_{i}= \left\langle\begin{array}{cc}1&\mbox{when}&N_{i}^{0}\geq N_{i}^{tr}\\ 1-d_{i}/d_{max}&\langle\begin{array}{cc}when&N_{i}^{0}\leq N_{i}^{tr}\\ when&N_{i}^{0}<N_{i}^{tr}\end{array}\end{array}\right. \tag{8}\]  
where \(N_{i}^{0}\) is the original NDVI time series value after outlier recognition, \(N_{i}^{tr}\) is the smoothed NDVI time series value, and \(W_{i}\) is the weight of the ith point, \(d_{i}=\left|N_{i}^{0}-N_{i}^{tr}\right|\) and \(d_{max}\) is the maximum of the absolute difference value of \(N_{i}^{0}\) and \(N_{i}^{tr}\). When the time series meets the condition: iteration \(times>n\) or \(abs(F_{k}-F_{K-1})<Delta_{K}\) (\(n\) is set to 20 and \(Delta_{K}\) is set to 0.01 for the NDVI time series), then the smoothing process terminates.  
In addition, for time series datasets other than NDVI, to evaluate the smoothness of the time series, the mean slope of every point in the time series is calculated. When the maximum \(MeanSlope\) of all the points meets the condition, the SG process will terminate and the specific condition can be defined as per Equation (9), where \(MMS\) is the maximum \(MeanSlope\) of all the points in the time series; \(MMS_{M}\) is the \(MMS\) of the \(M\)th filter process; \(n\) is the number of iterations; \(Delta_{M}\) is the threshold for the difference between \(MMS_{M+1}\) and \(S_{M}\); \(n=5\) and \(Delta_{M}=0.1\).  
\[\begin{array}{c}MeanSlope=\frac{dN_{K-1}N_{K}+dN_{K}N_{K+1}}{2}\\ MMS=MAX(MeanSlope_{1},\ldots,MeanSlope_{n})\\ MMS_{M-1}\geq MMS_{M}\leq MMS_{M+1}\\ \mbox{or iteration }times>n\\ \mbox{or }abs(MMS_{M+1}-MMS_{M})<Delta_{M}\end{array} \tag{9}\]  
To ensure that the smoothed time series data retains the characteristics of the original time series, all the time series are smoothed by the enhanced SG filtering method. Finally, we defined, at most, 20 smoothing times for the NDVI time series and 5 smoothing times for the GPP, reflectance, and LAI data, which can retain the original data characteristics as much as possible.