1

I keep getting errors on daily. The output: a raster image with calculating monthly CHIRPS rainfall between January 1980 -December 2018 for Sierra Leone (SLE is the ISO code).

// Set years and month
var startYear = 1980;
var endYear = 2018;
var years = ee.List.sequence(startYear, endYear);
var months = ee.List.sequence(1,12);
// load the image collection
//Import gaul-minus-water as table
//Import CHIRPS daily as Daily



var iso3 = 'SLE';
table = table.filter(ee.Filter.eq('ISO3_code', iso3 ));


// make monthly summed mosaics
// loop over the years and months to get summed monthly images
var byMonth = ee.ImageCollection(ee.FeatureCollection(years.map(function(y){
  var yearCollection = Daily.filter(ee.Filter.calendarRange(y, y, 'year'));
  var byYear = ee.ImageCollection.fromImages(
    months.map(function(m) {
      var summedImage = yearCollection.filter(ee.Filter.calendarRange(m, m, 'month'))
                  .reduce(ee.Reducer.sum()); 
      var date = ee.Date.fromYMD(y, m, 1).format("MM_dd_YYYY");
      return summedImage.set('system:time_start', ee.Date.fromYMD(y, m, 1)).rename(date);
      //.set('month', m).set('year', y); // eventually set year and month 
  }));
  return byYear;
})).flatten());

// filter the empty one out
var outputMonthly = byMonth.filter(ee.Filter.listContains('system:band_names', 'constant').not())
                    .sort('system:time_start').toBands();
print(outputMonthly);

var imageclip = outputMonthly.clip(table); 

Map.addLayer(imageclip);

var proj = 'EPSG:4326'
var desc = 'Total_Precip'
Export.image.toCloudStorage({ 
  image: imageclip,
  description:desc,
  scale: 1000,
  crs: proj,
  maxPixels:1e13
  });
  • Please add details on the error message and provide a link to a working script. – Daniel Jan 1 at 19:41