TransWikia.com

Selection of only monthly data on Google Earth Engine?

Geographic Information Systems Asked by P_P on May 29, 2021

Can you suggest an approach to select January Landsat 5 data between 2000 to 2010 and calculate its mean?

In other words, the mean of the all January images from 2000 to 2010.

One Answer

You nee to use ee.Filter.calendarRange(start,end,field) to filter by all Januaries from 2000 to 2010.

field could be:

  • field (String, default: "day_of_year"): The calendar field to filter over. Options are: 'year', 'month', 'hour', 'minute', 'day_of_year', 'day_of_month', and 'day_of_week'.

So, the code is:

var imageCollection = ee.ImageCollection("LANDSAT/LT05/C01/T1_TOA");

// Use ee.Filter.calendarRange to filter by year and month

var img = imageCollection.filter(ee.Filter.calendarRange(2000,2010,'year'))
.filter(ee.Filter.calendarRange(1,1,'month'));

// reduce image collection with mean()
var mean = img.mean();

// Set visualization parameters
var vizParams = {
  bands: ['B3', 'B2', 'B1'],
  min: 0,
  max: 0.5,
  gamma: [0.95, 1.1, 1]
};

// add layer
Map.addLayer(mean,vizParams);

This code process specifically your task description, doesn't consider cloud mask or a cloud coverage filter.

Answered by aldo_tapia on May 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP