You are trying to calculate a temporal mean and regional mean time series chart for 260,666 observations. This is just a lot of data. Two issues I see here:
- The NASA/NEX-GDDP dataset includes 21 models and multiple greenhouse gas concentration scenarios, each at daily cadence (each unique combination is an image in the collection). Try filtering to a single model and scenario:
var nex = ee.ImageCollection("NASA/NEX-GDDP")
.filterDate('2010-01-01', '2010-01-02'); // 1 day
print('Unfiltered observations:', nex);
print('Models:', ee.List(nex.aggregate_array('model')).distinct());
print('Scenarios:', ee.List(nex.aggregate_array('scenario')).distinct());
print('N
// unfilteredFilter observations:',by nex);
model and scenario.
var nexFiltered = nex.filter(ee.Filter.and(
ee.Filter.eq('model', 'BNU-ESM'), ee.Filter.eq('scenario', 'rcp85')));
print('N filtered'Filtered observations:', nexFiltered);
- Daily precision for calculating a 20-year mean seems unwarranted (i.e. a mean of monthly means will likely get you about the same answer.) My recommendation would be to use the NEX-DCP30 ensemble dataset, which is a monthly statistic. Note that it also includes a variety of greenhouse gas concentration scenarios, so you'll want to filter by 'scenario'.
Additionally, I see the you are interested in historical climate; note that NEX-GDDP data are modeled projections (there is a "historical" scenario pre-2006, but better historical datasets exist). You might check out ERA5 monthly and daily aggregates instead.