0

I am using Landsat 8 and 9 collection 2 level 1 data to calculate land surface temperature in ArcGIS. I want to create a cloud-free image using the QA band.

How can I use the QA band to mask any clouds?

What pixel values of the QA band are considered free of clouds?

1
  • 1
    As per the Tour there should be only one question asked per question.
    – PolyGeo
    Jan 8, 2023 at 22:48

1 Answer 1

0

You can find the meaning of the quality bands here: https://www.usgs.gov/core-science-systems/nli/landsat/landsat-collection-2-quality-assessment-bands (under maintenance)

However, if you are using Python and you want a library that loads those bands for you (already in TB), you could use EOReader directly:

from eoreader.reader import Reader
from eoreader.bands import TIR_1, CLOUDS

prod = Reader().open(r"LC08_L1TP_200030_20201220_20210310_02_T1.tar")

# Load those bands as a dict of xarray.DataArray
tb_bands = prod.load([TIR_1, CLOUDS])
tb_bands[TIR_1].plot(cmap="viridis")
tb_bands[CLOUDS].plot()

enter image description here enter image description here

Then you just have to remove cloudy pixels:

cloud_free = tb_bands[TIR_1].where(tb_bands[CLOUDS] == 0)
cloud_free.plot(cmap="viridis")

enter image description here

Disclaimer : Disclaimer: I am the maintainer of EOReader

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.