I need to compute the mean monthly precipitation sum between 2001 and 2021 (May to September). I know ho to compute the mean over all months of the period but I don't know how to handle the unit. My first attempt to compute the monthly sum was to multiply each value (mm/hr) with the number of hours (24*31) but there are months with only 30 days so this leads to higher values in June and September. Is there any way to solve this problem?
Before that I tried to use the half-hour GPM Dataset (which I preferred first because I need to do this with 2022 as well to compute the anomaly) to just compute the sum of all values per month but I always got the error "User memory limit exceeded" while computing so I changed my strategy.
var gpmMonthly = ee.ImageCollection("NASA/GPM_L3/IMERG_MONTHLY_V06").select('precipitation').filterDate('2001-01-01', '2021-09-01')
var gpmMonthly = gpmMonthly.map(function(image) {
return image.multiply(31*24).copyProperties(image, ['system:time_start'])
})
var months = ee.List.sequence(1, 12);
var monthlyMean = ee.ImageCollection.fromImages(
months.map(function (m) {
return gpmMonthly.filter(ee.Filter.calendarRange(m, m, 'month'))
.select(0).mean()
.set('month', m);
}))
monthlyMean = monthlyMean.filter(ee.Filter.rangeContains('month', 5, 9))