0

How could I create a function calculating NDVI difference from actual NDVI and mean NDVI values to add as a new band to the collection?

Something like this:

var ndvi_diff = ndvi.map(function (image) {
  return image.subtract(ndvi_mean).addBands('ndvi_diff');
});

Can I do calculations with different image collections?

Note that I don’t want to reduce the collection into a single image but I would like to have the mean and then the calculated formula for all images in the same collection as new bands.

1 Answer 1

0

Similar to this question: Calculating the vegetation condition indices over a stacked vegetation indices in Google Earth Engine

You could try something like this:

var getdiff = function(image){
  var diff = image.subtract(meanImage).rename('ndvi_diff')
  
  return diff // only the vci
}

https://code.earthengine.google.com/9a0d7ac049865ef12eea34e13871cb12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.