I have an Image Collection, I want to Calculate a Normalized difference and got this Function called ND
/////normalized Differense///////
function ND(Im,B1,B2){
var four = Im.select(B1)
var eight = Im.select(B2)
return eight.subtract(four).divide(four.add(eight)).copyProperties(Im);
}
this way I would call ND but miss the additional Arguments :
ImageCollection.map(ND)
this way I would get an error regarding the second argument of .map:
ImageCollection.map(ND,'B4','B8')
this way I will get "a is not a function":
ImageCollection.map((ND,'B4','B8'),)
ImageCollection.map([ND,'B4','B8'],)
I know there is a ".NormalizedDifference" Function, and I will use it. It's more of a general question how do I map over an ImageCollection with a function that needs multiple inputs?