Area under the curve of Sentinel-2 time-serie using GEE

Smoothed values (73; as number of elements in smoothed Image Collection) from CSV file were converted in a list variable at the beginning of following code. As these values have a spacing of 5 days then, the value of h is 5 in following lines.

var smoothed = [0.3,0.317,0.379,0.452,0.519,0.573,0.61,0.629,0.628,0.613,0.587,0.556,0.521,

var n = ee.List(smoothed).size().subtract(1);
print("number of values", n.add(1));

var h = 5;

var serverList = ee.List.sequence(1, n, 2);


serverList ={

  n = ee.Number(n).int();
  var n_sub = n.subtract(1);
  var n_add = n.add(1);

  var sum = ee.Number.expression(
      '(h/3)*(v1 + 4*v2 + v3)',{
      'v1': ee.List(smoothed).get(n_sub),
      'v2': ee.List(smoothed).get(n),
      'v3': ee.List(smoothed).get(n_add),
      'h': h
  return sum;

var area = ee.List(serverList).reduce(ee.Reducer.sum());

print("area under the curve (AUC)", ee.Number(area).format('%.2f'));
This entry was posted in Google Earth Engine. Bookmark the permalink.

3 Responses to Area under the curve of Sentinel-2 time-serie using GEE

  1. Hello, sir. I am a beginner in GEE. You helped me a lot with my SEBAL model which I need for my work. It is uncomfortable for me to ask all the time via gisstack. I need some guidance to complete my model. DO you do online consultation for money? Said Baha

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s