## 3 Methods
### High-Quality Crop-Specific NDVI Time-Series Reconstruction
#### 3.1.1 Extracting \(NDVI\) Upper Envelope  
Regarding the fact that most noise in \(NDVI\) time series is negatively biased, in the initial step, we attempt to reconstruct the upper envelope of the \(NDVI\) time series while preserving as much of the original data as possible using a number of strategies inspired by [51]. The first step involved the identification of all local maximum values across and starting from the first day of the \(NDVI\) time series. In this process, a local maximum is defined as a point position \(M_{t}\) with a value \(M_{i}\) that is the largest in the interval \((M_{t}-h,\)\(M_{t}+h)\). The search interval for the local maximum was set to be small in such a way that the \(M_{i}\) value is larger than its two direct neighbouring points. The second step is the identification of the other points that are highly likely to form the upper envelope of the \(NDVI\) time series but have not been recognised as local maxima in the first step. According to the assumptions mentioned above, a good quality \(NDVI\) point usually follows the gradual process of vegetation dynamics, implying that a sudden change in temporal values cannot be caused by natural conditions changes; thus points with rapid change were considered outliers, while those with a low rate of change were preserved to join the sets of local maxima to form the full upper envelope. The approach consists of using a very simple discriminant function that chronologically passes through the times series points and classifies the low-value noises based on the sets of local maxima found in the first step. The discriminant function of time \((t)\) can be expressed according to Equation (2).  
\[f(t)=\left(\frac{\sigma}{\sigma+1}\right)^{\text{int}(t-i)}M_{i} \tag{2}\]  
\(\sigma\) is the attenuation coefficient used to control the rate of decline in the discriminant function, and \(t-i\) is the temporal distance between \(NDVI_{t}\) and \(M_{i}\). \(NDVI_{t}\) is the original \(NDVI\) value of the point at time \(t\), and \(M_{i}\) denotes the value of the last local maxima to time \(t\). Selecting a proper attenuation coefficient \(\sigma\) is very important because choosing one too small can result in the identification of low \(NDVI\) points as envelope nodes and vice versa. Initially, the \(\sigma\) value is expressed as a percentage ranging from 1 to 100. To determine the optimal \(\sigma\) value, we tested various options for each crop due to their unique characteristics of the \(NDVI\) time series, which require different levels of filtering. We start with a reasonable range around 60, using a margin of \(\pm\)20 and an increment of 2, because 60 was identified as a strong hypothesis for the appropriate degree in [51]. Based on these tests and visual interpretations, a set of \(\sigma=40\), \(\sigma=50\), and \(\sigma=66\), respectively, for corn, winter wheat, and sugar beet appears to be appropriate. To obtain the rest of the upperenvelope nodes, each \(NDVI_{l}\) point from all the \(NDVI\) values was inserted as a new \(M_{i}\) in every iteration if it satisfied the following rule in Equation (3).  
\[NDVI_{l}-f(t)\geq 0 \tag{3}\]  
The points that did not meet this condition were excluded from the time series vector and substituted with non-data values. Subsequently, we filled the resulting gaps in the time series by linear interpolation between adjacent reliable values over time, resulting in a continuous time series vector. Finally, two analysis ensembles of the model state are derived in time \(t\) from the forward and backward analysis, respectively. In doing so, the function compares the values of the two curves in pairs and returns a final vector that contains the maximum values from each pair.