I am trying to normalize a data set. But getting an error with
.map is not a function
How can I solve this issue?
var StRain = raindata.subtract(ltamean).divide(ltastd);
var SPI = StRain.map(function(image){
var Imin = StRain.reduce(ee.Reducer.min())
var Imax =StRain.reduce(ee.Reducer.max())
return image.expression('1-(Ia-Imin)/(Imax-Imin)',
{Ia: image,
Imin: Imin,
Imax:Imax
}).clip(AOI).rename('SPI')
.copyProperties(image, ['system:time_start'])
.set('date', image.date().format('YYYY_MM_dd'))
})
StRain.reduce(...)
inside the map function beimage.reduce(...)
? Currently, you are performing an identical operation for every image in the collection. Otherwise, it should be outside ofmap()
raindata
. Could you define it in the example code (perhaps using an asset from the Earth Engine public data catalog)?