Sowjanya
Sowjanya

Reputation: 11

why do we use ee.number().pow().int in Cloud masking using Google earth engine

I didn't understand why we use raise number 2 with power 3 for accessing cloud bit mask

and what exactly means setting flag to 0 while performing bitwiseAnd operation

var maskL8SR = function(image) {
  // Bits 3 and 5 are cloud shadow and cloud, respectively.
  var cloudShadowBitMask = ee.Number(2).pow(3).int();
  var cloudsBitMask = ee.Number(2).pow(5).int();
  // Get the QA band.
  var qa = image.select('pixel_qa');
  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0).and(
            qa.bitwiseAnd(cloudsBitMask).eq(0));
  return image 

Upvotes: 1

Views: 177

Answers (0)

Related Questions