I need to make a classification to eliminate the snow cover, for this we are following the ATD method of Gafurov, in which we observe 1 day before and 2 days after on a given pixel or vice versa, in this way, check if it corresponds to land or snow (eg: if the cloudy pixel has two previous days with clouds, it will be assumed that it is snow). I have thought the steps but I don't know how, my idea is:

This is my code

var ROI = ee.Geometry.Rectangle([-71.633, -32.229,
                                 -69.943, -33.200]);

//Importar coleccion de imagenes MODIS 10A1006 c6-TERRA
var colMODIS = ee.ImageCollection("MODIS/006/MOD10A1")
                 .select('Snow_Albedo_Daily_Tile_Class'); //Banda de nubosidad
// Define time range
var startyear = 2000;
var endyear = 2020;

var startmonth = 1;
var endmonth = 12

///    **¿how to calculate monthly average?**     ////

//Establecer la fecha en formato de fecha ee
var startdate = ee.Date.fromYMD(startyear,startmonth,1);
var enddate = ee.Date.fromYMD(endyear,endmonth,31);

//Función para reclasificar los valores de nubosidad (MOD10A1)
var CloudMask = function(image){
  var mask = image.eq(150).multiply(100);
  return mask.set('system:time_start', image.get('system:time_start'));

var cloudCollection = colMODIS.map(CloudMask);
//print('cc', cloudCollection);

**How do I add the iteration to the masked clouds or pixel I need to determine?**
///iterando sobre un mismo dia///////

var aDate = ee.Date.fromYMD(2015,12,21);
var days = ee.List.sequence(-1, +2);
var dates = days.map(function(d) {
  return aDate.advance(d, 'day');

var iteracion = cloudCollection.map(CloudMask);
//print('cc', cloudCollection);

//Muestra la primera imagen de la colección

  • You can use dates for filtering imageCollection (using .millis()) and then compute the value with expression (converting imageCollection to image) or with the other tools. I don't know if GGE will be able to run this task for 20 years in one round – aldo_tapia Feb 18 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.