将GPM每小时数据汇总为GEE中的每日数据

编程入门 行业动态 更新时间:2024-10-11 21:31:01
本文介绍了将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))

推荐答案

请尝试一下我的软件包 pkg_trend . aggregate_prob函数的功能与 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链接为 code.earthengine.google/2e04ad4a4bee4bee6789af23bfac42f63025

更多推荐

将GPM每小时数据汇总为GEE中的每日数据

本文发布于:2023-10-18 17:28:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504874.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据   每小时   GPM   GEE

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!