Select to view content in your preferred language

Set a Raster's pixels to NoData using a separate raster

232
0
08-29-2022 07:28 PM
LewisTrotter
New Contributor III

Hello,

I have a full Landsat scene that contains the usual bands (RGB NIR etc) as well as a seperate QA cloud mask band with the exact same dimensions and pixel size. I am trying to set all pixels in the full Landsat scene to NoData (-1) wherever a value of 0, 2, or 3 exist in the cloud mask.

Are there any efficient approaches to this in the SDK? I came across the Mask Function (not the GP tool) in Pro, but from what I understand these are not available in the SDK. I also do not have access to Spatial Analyst to use Extract By Mask.

I've currently implemented a a for loop that basically iterates the cloud mask and whenever the value is found, updates the same pixel in the full Landsat scene, but it seems suboptimal to me.

I was looking at the GetNoDataMask and SetNoDataMask methods but as far as I'm aware my raw tiffs do not have these encoded.

Cheers

0 Kudos
0 Replies