0

I have an image collection with a cloud mask and an NDVI band already applied to it. It's called s2CloudMasked.

I have further applied the following mask function to filter out NDVI values lower than 0.25:

//Mask out bad NDVI// 
var maskNDVI = function(image){
    var NDVI = image.select("NDVI");
    var bad_value = image.updateMask(NDVI.gt(0.25));
    return(bad_value);
};

//Clean up NDVI mask//
var s2CloudMasked = s2CloudMasked.map(maskNDVI);

It works, however, a few specific data points slightly change after the process and I can't understand why. Examples:

  • All pixels with NDVI values < 0.25 were removed but for one which changed its value to 0.34 (originally 0.179)
  • A few pixels (not all) above the 0.25 threshold still changed values slightly, i.e. from 0.275 to 0.305 or from 0.588 to 0.608

This doesn't affect my objectives at all, so I can use this code as is. But I am still curious as to why this is happening.

This is the link to the code, if it helps.

0 Answers0