def get_pqa_mask(self, pqa_dataset_path, good_pixel_masks=[32767,16383,2457], dilation=3):
        pqa_gdal_dataset = gdal.Open(pqa_dataset_path)
        assert pqa_gdal_dataset, 'Unable to open PQA GeoTIFF file %s' % pqa_dataset_path
        pqa_array = pqa_gdal_dataset.GetRasterBand(1).ReadAsArray()
        del pqa_gdal_dataset
        
        log_multiline(logger.debug, pqa_array, 'pqa_array', '\t')

        # Ignore bit 6 (saturation for band 62) - always 0 for Landsat 5
        pqa_array = pqa_array | 64
        
    #    logger.debug('pqa_array = %s', pqa_array)
                    
        # Dilating both the cloud and cloud shadow masks 
        s = [[1,1,1],[1,1,1],[1,1,1]]
        acca = (pqa_array & 1024) >> 10
        erode = ndimage.binary_erosion(acca, s, iterations=dilation, border_value=1)
        dif = erode - acca
        dif[dif < 0] = 1
        pqa_array += (dif << 10)
        del acca
        fmask = (pqa_array & 2048) >> 11
        erode = ndimage.binary_erosion(fmask, s, iterations=dilation, border_value=1)
        dif = erode - fmask
        dif[dif < 0] = 1
        pqa_array += (dif << 11)
        del fmask
        acca_shad = (pqa_array & 4096) >> 12
        erode = ndimage.binary_erosion(acca_shad, s, iterations=dilation, border_value=1)
        dif = erode - acca_shad
        dif[dif < 0] = 1
        pqa_array += (dif << 12)
        del acca_shad
        fmask_shad = (pqa_array & 8192) >> 13
        erode = ndimage.binary_erosion(fmask_shad, s, iterations=dilation, border_value=1)
        dif = fmask_shad - erode
        dif[dif < 0] = 1
        pqa_array += (dif << 13)
        
        #=======================================================================
        # pqa_mask = ma.getmask(ma.masked_equal(pqa_array, int(good_pixel_masks[0])))
        # for good_pixel_mask in good_pixel_masks[1:]:
        #    pqa_mask = ma.mask_or(pqa_mask, ma.getmask(ma.masked_equal(pqa_array, int(good_pixel_mask))))
        #=======================================================================
        pqa_mask = numpy.zeros(pqa_array.shape, dtype=numpy.bool)
        for good_pixel_mask in good_pixel_masks:
            pqa_mask[pqa_array == good_pixel_mask] = True
            
        return pqa_mask
dataset/ETHPy150Open GeoscienceAustralia/agdc/src/stacker.py/Stacker.get_pqa_mask/swapped operands of `-`