Kong 2019, ISPRS, Non-parametric weighted Whittaker smoothing in GEE
Figure 6. poly_1
(Sichuan): https://code.earthengine.google.com/46813e807b1079cdf4bd27e2b3970faf
The development version from GitHub with:
# install.packages("devtools")
install.packages("phenofit")
devtools::install_github("kongdd/gee_whittaker")
library(whittaker)
The following is the main GEE script of the simpler version Whittaker and an examples which smoothed 4-day MODIS LAI images in PML_V2 model.
Please note that there are four necessary steps when using this method, also shown in the above example:
-
Pre-process, unmask NA values and initialize weights
If skip this step, it will lead to matrix dimensions not equal, matrix can’t be inversed …
-
apply Whittaker method (a 2d image array returned)
-
convert 2d array into multi-bands (every single date corresponds to band)
There is a small trick you should know:
you should not convert 2d image into ImageCollection. If so, for each exporting task (one date one task), matrix operation in Whittaker (the most time-consuming part) will be executed repeatedly. Then, it will lead to n times slower (n is the number of images).
Just export multi-bands image directly!
-
EXPORT the smoothed result
Please note that smoothing algorithm costs lots of computing resource. You can’t smooth imagecollection and do further calculation or analysis right now in the same script in GEE. The best option is exporting smoothed images first.
At last, you should select a appropriate lambda parameter carefully when using this method! But if you are process MODIS, you can have a try about wWHd in my previous blog.
For Chinese users, you might interested about my another blog in 知乎, I have explained some technique details in it.
Finally, if you not satisfied the smoothed result, you can have a try about other weights updating methods.
-
test/whit_lambda/02_whit_lambda_main.R
: Prepare input data, calibrate optional lambda based onV-curve
theory. -
test/whit_lambda/03_whit_lambda_formula.R
: calibrate the empirical lambda equation based on Multiple Linear Regression
-
test/s1_reference_curve.R:
Get reference curve, and used as benchmark to evaluate smoothing methods’ performance. -
test/s2_evaluate_performance.R
: Evaluate performance of different smoothing methods -
test/s4_parameters_sensitivity.R
: Parameter sensitivity analysis
[1]. Kong, D., Zhang, Y., Gu, X., & Wang, D. (2019). A robust method for reconstructing global MODIS EVI time series on the Google Earth Engine. ISPRS Journal of Photogrammetry and Remote Sensing, 155 (May), 13–24. https://doi.org/10.1016/j.isprsjprs.2019.06.014
Keep in mind that this repository is released under a GPL3 license.