将GPM每小时数据汇总为GEE中的每日数据 [英] Aggregate GPM hourly data to daily in GEE
本文介绍了将GPM每小时数据汇总为GEE中的每日数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要汇总GPM集合每天48个半小时图像的总和,以获取带有"precipitationCal"乐队的图像集合和每日图像
I need to aggregate the sum of 48 half hourly images per day of a GPM collection getting a imageCollection with the band "precipitationCal" and daily images
我正在尝试填充并迭代一个空的featureCollection,但是我得到一个没有图像的空集合
I've trying to fill and iterate a empty featureCollection but I get a empty collection without images
var dataset = ee.ImageCollection('NASA/GPM_L3/IMERG_V05')
var startdate = ee.Date.fromYMD(2014,3,1)
var enddate = ee.Date.fromYMD(2014,4,1)
var precipitation = dataset.filter(ee.Filter.date(startdate,enddate)).select('precipitationCal')
print(precipitation)
var difdate = enddate.difference(startdate, 'day')
// Time lapse
var lapse = ee.List.sequence(0, difdate.subtract(1))
var startdate = ee.Date('2014-01-01')
var listdates = lapse.map(function(day){
return startdate.advance(day, 'day')
})
var pts = ee.FeatureCollection(ee.List([]))
var newft = ee.FeatureCollection(listdates.iterate(function(img, ft) {
// Cast
ft = ee.FeatureCollection(ft)
var day = ee.Date(img)
// Filter the collection in one day
var day_collection = precipitation.filterDate(day, day.advance(1, 'day'))
// Get the sum of all 24 images into one Image
var sum = ee.Image(day_collection.sum())
// Return the FeatureCollection with the new properties set
return sum
}, listdates))
推荐答案
请尝试一下我的软件包 R语言.
Please have a try about my package pkg_trend. aggregate_prob
function in it, works just like aggregate
in R language.
var imgcol_all = ee.ImageCollection('NASA/GPM_L3/IMERG_V05');
function add_date(img){
var date = ee.Date(img.get('system:time_start'));
var date_daily = date.format('YYYY-MM-dd');
return img.set('date_daily', date_daily);
}
var startdate = ee.Date.fromYMD(2014,3,1);
var enddate = ee.Date.fromYMD(2014,4,1);
var imgcol = imgcol_all
.filter(ee.Filter.date(startdate,enddate)).select('precipitationCal')
.map(add_date);
// imgcol = pkg_trend.imgcol_addSeasonProb(imgcol);
print(imgcol.limit(3), imgcol.size());
var pkg_trend = require('users/kongdd/public:Math/pkg_trend.js');
var imgcol_daily = pkg_trend.aggregate_prop(imgcol, "date_daily", 'sum');
print(imgcol_daily);
Map.addLayer(imgcol_daily, {}, 'precp daily');
GEE链接为 https://code.earthengine.google.com/2e04ad4a4bee4bee6789af23bfac42f63025
这篇关于将GPM每小时数据汇总为GEE中的每日数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文