Tuesday, 4 April 2017

google earth engine - 10 days composite from Sentinel 2 Images Collection


A monthly composite can be made using the following code, I take example from Sentinel 2 L1C:


var geometry = ee.Geometry.Point([109.061, 11.78]); 
var col = ee.ImageCollection('COPERNICUS/S2')
.filterBounds(geometry).filterDate('2018-01-01','2019-01-01');
//Monthly Images
var months = ee.List.sequence(1,12);
var years = ee.List.sequence(2018,2018);

// monthly composite
var monthlyImages = ee.ImageCollection.fromImages(
years.map(function (y) {
return months.map(function(m){
var w = col.select('B1').filter(ee.Filter.calendarRange(y, y, 'year'))
.filter(ee.Filter.calendarRange(m, m, 'month'))
.mean()
//.median()
//.min()
.set('system:time_start',ee.Date.fromYMD(y,m,1));

return w.set('year', y)
.set('month', m)
.set('date', ee.Date.fromYMD(y,m,1))
.set('system:time_start',ee.Date.fromYMD(y,m,1))

});
}).flatten());

print(monthlyImages)


How do I do a decadal composite (every 10 days)?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...