I try to use this Function with ee.ImageCollection.map()
var Fail = function(Im){
var min = ee.Image(Im.reduceRegion(ee.Reducer.min(),aoi).get('B10').getInfo())
var max = ee.Image(Im.reduceRegion(ee.Reducer.max(),aoi).get('B10').getInfo())
var Failvalue = Im.expression(
'( Im - min )/( max -min )', {
'Im': Im,
'min': min,
'max': max,
})
return Failvalue
}
Using this Function on a Single Image will not obtain an error, see Success
Using this Function on an ee.Colection
with .map()
results in:
Failed to decode JSON.
Error: Field 'value' of object '{"type":"ArgumentRef","value":null}' is missing or null.
Object: {"type":"ArgumentRef","value":null}.
The problem lies within the ee.ReduceRegion()
, which retrieves a dictionary. This dictionary is unpacked with .get('B10')
and Determined to a value with .getInfo()
, so that it can be used as numeric input in ee.Image()
is there another way to construct an Image from a number, retrieved via reduction of a region?