0

I am trying to normalize my data. But it says, .map is not a function. How can I come up with this?

var Stprep = raindata.subtract(ltamean).divide(ltastd);

var SPI = Stprep .map(function(image){
 var Imin = Stprep .reduce(ee.Reducer.min())
 var Imax =Stprep .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'))

})

Ryan M
  • 18,333
  • 31
  • 67
  • 74

1 Answers1

0

You can map over an ImageCollection, not just an image. Stprep seems to be an image

CrossLord
  • 574
  • 4
  • 20