knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

GEE Whittaker

AppVeyor build status

Non-parametric weighted Whittaker smoothing in GEE

Calibrate and Validate in R

This package is just used to evaluate the performance of gee_Whittaker, which is hosted on another repository gee_packages.

The development version from GitHub with:

# install.packages("devtools")
install.packages("phenofit")
devtools::install_github("kongdd/gee_whittaker")
library(whittaker)

Whittaker in Google Earth Engine (GEE)

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.

https://github.com/kongdd/gee_packages/blob/master/Math/pkg_whit.js#L188 https://github.com/kongdd/PML/blob/master/src/data_LAI_Whittaker.js

Please note that there are four necessary steps when using this method, also shown in the above example:

  1. Pre-process, mask NA values and initialize weights

    If skip this step, it will lead to matrix dimensions not equal, matrix can't be inversed ...

  2. apply Whittaker method (a 2d image array returned)

  3. 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!

  4. 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.

Calibration and Validation

Calibrate lambda equation

  1. test/whit_lambda/02_whit_lambda_main.R: Prepare input data, calibrate optional lambda based on V-curve theory.

  2. test/whit_lambda/03_whit_lambda_formula.R: calibrate the empirical lambda equation based on Multiple Linear Regression

Validate Whittaker performance

  1. test/s1_reference_curve.R: Get reference curve, and used as benchmark to evaluate smoothing methods' performance.

  2. test/s2_evaluate_performance.R: Evaluate performance of different smoothing methods

  3. test/s4_parameters_sensitivity.R: Parameter sensitivity analysis

References

[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

Acknowledgements

Keep in mind that this repository is released under a GPL3 license.



kongdd/gee_whittaker documentation built on April 14, 2024, 5:22 a.m.