Skip to content

Instantly share code, notes, and snippets.

@hallahan
Created November 24, 2013 01:40
Show Gist options
  • Save hallahan/7622315 to your computer and use it in GitHub Desktop.
Save hallahan/7622315 to your computer and use it in GitHub Desktop.
Trying to cut holes in B4 with the BQA band
import os
import sys
import arcpy
import numpy
import math
from arcpy.sa import *
arcpy.CheckOutExtension('Spatial')
arcpy.env.overwriteOutput = True
cwd = os.getcwd()
inputPath = cwd + "\\input\\"
outputPath = cwd + "\\output\\"
bqa = inputPath + "bqa.tif"
b4 = inputPath + "b4.tif"
# holyImg = Raster(b4) * ( (Raster(bqa) != 61440) and (Raster(bqa) != 59424) and (Raster(bqa) != 57344) and (Raster(bqa) != 56320( and (Raster(bqa) != 53248) and (Raster(bqa) != 52256) )
holyImg = Raster(b4) * (Raster(bqa) != 61440)
holyImg.save(outputPath + "holy.tif")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment