I have a function to get an average value per month for a band from an image collection. Full code is here.
var dat = ee.ImageCollection('NOAA/CDR/SST_WHOI/V2').select('sea_surface_temperature')
.filterDate(ee.Date('1990-01-01'), ee.Date('2000-01-01'))
.filterBounds(ROI);
// month data for dataset
var startyear = 1990;
var endyear = 1999;
var startmonth = 1;
var endmonth = 12;
var startdate = ee.Date.fromYMD(startyear, startmonth, 1);
var enddate = ee.Date.fromYMD(endyear , endmonth, 1);
var years = ee.List.sequence(startyear, endyear);
var months = ee.List.sequence(1, 12);
var monthlySST = ee.ImageCollection.fromImages(
years.map(function (y) {
return months.map(function(m) {
var w = dat.filter(ee.Filter.calendarRange(y, y, 'year'))
.filter(ee.Filter.calendarRange(m, m, 'month'))
.mean();
return w.set('year', y)
.set('month', m)
.set('system:time_start', ee.Date.fromYMD(y, m, 1));
});
}).flatten()
);
In order to extract the data I've been plotting a graph then exporting as a csv.
print(ui.Chart.image.series(monthlySST, ROI, ee.Reducer.mean(), 4000)
.setOptions({
title: " Sea surface temperature mean by month of the year ",
hAxis: {title: 'Time'},
vAxis: {title: ' Sea surface temperature (°C)'},
colors: ['#EF851C'],
pointSize: 3}));
However, I'm trying to export a very large time period. And the graph times out or exceeds user memory. I tried exporting the image collection as a table but it doesn't include the the mean monthly band value in the table. Is there anyway of doing this?