0

I am trying to extract a time series of mean daily temperatures that intersect with a point feature from the ERA5 dataset in Google Earth Engine. For some rages of years (e.g., '1979' to'1980'), the output throws an 'Internal Server Error'. Other ranges work fine.

Is there a more direct way to extract a time series from an entire image collection with this many data points, or will the server always be overloaded?

Thank you!!

var aoi = ee.Geometry.Point([-62.7962, 58.45]);
print(aoi);
Map.addLayer(aoi);

var early = ('1979');
var late =  ('1980');

// Load in image collection and filter by area and date
var era5_dat = ee.ImageCollection('ECMWF/ERA5/DAILY')
.filterDate(early,late) //filter years of interest 
.select('mean_2m_air_temperature') //
.map(function(image){return image.clip(aoi)}); //Clips data based on 'aoi'

print('collection', era5_dat);

//Create variables and extract data
var scale = era5_dat.first().projection().nominalScale().multiply(0.05); print(scale);
era5_dat = era5_dat.filter(ee.Filter.listContains('system:band_names', era5_dat.first().bandNames().get(0)));

var ft = ee.FeatureCollection(ee.List([]));
//Function to extract values from image collection based on point file and export as a table 
var fill = function(img, ini) {
  var inift = ee.FeatureCollection(ini);
  var ft2 = img.reduceRegions(aoi, ee.Reducer.first(), scale);
  var date = img.date().format("YYYYMMdd");
  var ft3 = ft2.map(function(f){return f.set("date", date)});
return inift.merge(ft3);
};

// Iterates over the ImageCollection
var profile = ee.FeatureCollection(era5_dat.iterate(fill, ft));
print(profile,'profile');

// Export
Export.table.toDrive({
  collection : profile,
  description : "ERA5-"+early+"-"+late,
  fileNamePrefix : "ERA5-"+early+"-"+late,
  fileFormat : 'CSV',
  folder: 'ERA5 - Basecamp',
  selectors: ["date","first"]
});
ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
emmadavis
  • 1
  • 1
  • I'm currently trying to export the raw data of ERA5 daily within a bounding box from GEE and haven't found a solution yet either. Does it work for you if you just extract the mean for one day? – avocado1 Feb 17 '20 at 11:23
  • This was weird, but I re-ran the code a few days after I posted this question (just to see!) and the script worked totally fine without making any changes. I did also report the server error through the GEE platform, so it is possible that it helped things along but no way of knowing for sure. Good luck! – emmadavis Feb 18 '20 at 14:29
  • Maybe I should try running the other scripts that I tried again. I actually tried to adapt your code to my needs and it didn't work out. I need the entire time series for most of the ERA5 period for a certain area in the ERA5 native resolution of 0.25 degree. Just now though I tried running your code and it literally just exports a list of dates in this format: "19790102". – avocado1 Feb 18 '20 at 17:35
  • Here's a link to my final (working) script in case it is helpful! https://code.earthengine.google.com/?scriptPath=users%2Femmalaureldavis%2FNDVI%3AERA5_PointData_Extract – emmadavis Feb 20 '20 at 15:49

0 Answers0