I'm using GSMaP image collection in Google Earth Engine, which has hourly precipitation data from 2000 to present. I have a script which helps getting data (as a table) from points from each available image in given period. Could anyone please assist me on how to make the function that it will sum the values of hourly data to daily. Please, find the script which should be improved below:
//Points
var p1 = /* color: #d63000 */ee.Geometry.Point([69.15, 54.8331]),
p2 = /* color: #98ff00 */ee.Geometry.Point([70.917, 54.433]),
p3 = /* color: #0b4a8b */ee.Geometry.Point([66.967, 54.367]);
// Collection of point
var pts = ee.FeatureCollection(ee.List([ee.Feature(p1),ee.Feature(p2), ee.Feature(p3)]))
// Import GSMaP data
var gsmap = ee.ImageCollection('JAXA/GPM_L3/GSMaP/v6/reanalysis')
.filterDate(ee.Date.fromYMD(2014,1,1), ee.Date.fromYMD(2015,1,1))
.select('hourlyPrecipRateGC');
// Empty Collection to fill
var ft = ee.FeatureCollection(ee.List([]))
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()
// writes the date in each feature
var ft3 = ft2.map(function(f){return f.set("date", date)})
// merges the FeatureCollections
return inift.merge(ft3)
}
// Iterates over the ImageCollection
var newft = ee.FeatureCollection(gsmap.iterate(fill, ft))
// Export
Export.table.toDrive(newft,
"KZ_GSMaP_14-15",
"KZ_GSMaP_point data",
"KZ_GSMaP_14-15")