code: def _calculate_cloud_ice_perc(self):
          
          self.output('Calculating cloud and snow coverage from QA band', normal=True, arrow=True)
          a = rasterio.open(join(self.scene_path, self._get_full_filename('QA'))).read_band(1)
  
          cloud_high_conf = int('1100000000000000', 2)
          snow_high_conf = int('0000110000000000', 2)
          fill_pixels = int('0000000000000001', 2)
          cloud_mask = numpy.bitwise_and(a, cloud_high_conf) == cloud_high_conf
          snow_mask = numpy.bitwise_and(a, snow_high_conf) == snow_high_conf
          fill_mask = numpy.bitwise_and(a, fill_pixels) == fill_pixels
  
          perc = numpy.true_divide(numpy.sum(cloud_mask | snow_mask),
                                   a.size - numpy.sum(fill_mask)) * 100.0
          self.output('cloud/snow coverage: %s' % round(perc, 2), indent=1, normal=True, color='green')
          return perc
docs: Return the percentage of pixels that are either cloud or snow with
          high confidence (> 67%).