I'm using QGIS to analyze some image of the NOLA area pre- and post-hurricanes. I'd like to calculate NDVI and a couple other indices for the images, but I want to exclude pixels with clouds in them from my final analysis. I already have an fmask band for each of the images, however I'm not sure how to incorporate that into the index calculation so that those pixels are excluded. Is this something I would need to do after calculating the indices? Ultimately I'm going to compute difference layers and use multidate classification for the change analysis.

I have access to QGIS, gdal, and otb, but not too much experience with the latter two.

  • 1
    You could use an if-else statment. If the pixel is covered with clouds set NDVI to -2 e. g. (in order to be sure that this values can never be calculated during a NDVI analysis) , else calculate NDVI
    – Mazu_R
    Commented May 7, 2018 at 9:49

1 Answer 1


I have always found it simpler to calculate indices over my whole image, then mask the result with whatever mask I need.

The only problem with this method is when the "unmasked" area is very small and distributed all over the image....but even then, if you just want to calculate some simple indices, you may not need bother with extracting those specific zones.

Your Answer

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

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