I want to map a function over an image collection of Sentinel 1 images. After the calculation, the id and the properties are removed. I tried to maintain the id with .copyProperties
in the return line but I got the error
Actual value for parameter 'id' must be a constant.
The function is very long, so I deleted the part between the brackets {...}
in the line var calcLee
. This link leads to the full script with the complete function: https://code.earthengine.google.com/8ee0437dfc5caedc4b9d284a77ae4282
function dbToPower(img){
return ee.Image(10).pow(img.divide(10));
}
function powerToDb(img){
return ee.Image(10).multiply(img.log10());
}
function refinedLee(image) {
var bandNames = image.bandNames();
var image_power = dbToPower(image);
var calcLee= ee.ImageCollection(bandNames.map(function(b){...})).toBands().rename(bandNames);
var result = powerToDb(ee.Image(calcLee));
return result.copyProperties(ee.Image(image.getString('id')));
// return result;
}