我正在使用NEX-GDDP来获取2018-01-01至2099-12-31期间某些点的21个GCM模型的每日气候数据(降水,最小温度和最大温度)。我为一个场景中的一个模型制作了这个脚本
//Dataset
var dataset = ee.ImageCollection('NASA/NEX-GDDP')
.filter(ee.Filter.date('2018-01-01','2099-12-31'))
.filterMetadata('scenario','equals','rcp45')
.filterMetadata('model','MPI-ESM-LR')
//Points of interest
var Acomayo = ee.Geometry.Point([-71.689166667,-13.921388889]),var Machupicchu = ee.Geometry.Point([-72.545555556,-13.166666667]),var Urubamba = ee.Geometry.Point([-72.129116546,-13.323123791]),var Pisac = ee.Geometry.Point([-71.849444444,-13.415833333]),var Ccatcca = ee.Geometry.Point([-71.56,-13.609722222]),var GranjaKcayra = ee.Geometry.Point([-71.875,-13.556666667]),var Pomacanchi = ee.Geometry.Point([-71.5357971,-14.027777778]),var Sicuani = ee.Geometry.Point([-71.236944444,-14.253333333]);
var pts = ee.FeatureCollection(ee.List([ee.Feature(Acomayo),ee.Feature(Machupicchu),ee.Feature(Urubamba),ee.Feature(Pisac),ee.Feature(Ccatcca),ee.Feature(GranjaKcayra),ee.Feature(Pomacanchi),ee.Feature(Sicuani)]));
//Export to table .CSV
// Empty Collection to fill
var ft = ee.FeatureCollection(ee.List([]));
//Without removal of null values ----------------------------------
//Function to extract values from image collection based on point file and export as a table
var fill = function(img,ini) {
// type cast
var inift = ee.FeatureCollection(ini);
// gets the values for the points in the current img
var ft2 = img.reduceRegions(pts,ee.Reducer.first(),30);
// gets the date of the img
var date = img.date().format("yyyy/MM/dd");
var scenario = img.get("scenario");
var model = img.get("model");
// writes the date in each feature
var ft3 = ft2.map(function(f){return f.set("date",date,"scenario",scenario,"model",model)});
// merges the FeatureCollections
return inift.merge(ft3);
};
// Iterates over the ImageCollection
var newft = ee.FeatureCollection(dataset.iterate(fill,ft));
//print(newft);
// Export
Export.table.toDrive({
collection: newft,description: 'GCM_diario',folder: 'Downscalling_Diario',fileFormat: 'csv'
});
脚本可以正常工作两天零两点,但是对于我需要的当前时间点和时间段,它在5个小时后仍然可以正常工作。为了减少数据量,我认为这些想法:
- 平均产品中21个GCM模型的每日数据,并使其成为一个ImgaeCollection,因此 只需按场景分开即可。
- 将每个变量(Pp,Tmin,Tmax)的ImageCollection导出到NetCDF仅包含点的区域(不知道是否是 可能)。
geometry = ee.Geometry.Polygon(
[[[-72.77555636882136,-12.867571480133547],[-72.77555636882136,-14.670820732958893],[-70.69914035319636,-12.867571480133547]]],null,false);
如果还有另一种下载此数据的方式,我会打开它。