Table 6.3 here describes the Landsat 8-9 Pixel Quality Assessment (QA_PIXEL) Value Interpretations.

Value 54596 contains both "clear" and "cirrus". What am I to make of it? A pixel can have only one class - either classified as clear or cirrus (similar to the SCL band in Sentinel-2), is it not? (same goes for value 21826 and others).

My ultimate goal is to mark cloudy images using the Google Earth Engine, but to that end, I would like first to understand the logic behind what seems to bo contradicting pixel values.

enter image description here

  • They differentiate between cirrus clouds - which can be seen trough and may be used for visual interpretation and 'normal' clouds - which cannot be viewed trough. Depending on what you want to do, you can still achieve it by visually interpreting scenes with cirrus-clouds, but not if there are thick clouds in the scene.
    – Vincé
    Commented Jan 3 at 13:56
  • Thanks, but the visual interpretation is not possible in my case. The interpretation is done by an algorithm, meaning that the decision whether to use an image or not should be based on the QA_PIXEL value
    – user88484
    Commented Jan 4 at 6:51
  • Ah, sorry, I thought your goal was to "understand the logic behind seemingly contradictory pixel values" as you had writen, and which I tried to touch upon. If it's just for your analysis, you can just use the pixel values that meet the criteria for your analysis.
    – Vincé
    Commented Jan 5 at 7:51
  • Your thought was correct, I want to understand it, so I can write an adequate algorithm to filter out cloudy images/pixels. As you wrote, sometimes the cirrus will interrupt my analysis (let's say it is for NDVI) and sometimes it won't, I thought (and hoped) there is a more definite answer to each pixel value similar to the SCL band in Sentinel-2.
    – user88484
    Commented Jan 7 at 7:03

1 Answer 1


This is more a question for the Landsat Products team than earth engine, but for what it's worth, here's the quality bits (and data prep) I use:

function prepareL8Col2(image) {
  bandList = ['SR_B2', 'SR_B3', 'SR_B4', 'SR_B5', 'SR_B6', 'SR_B7', 'ST_B10']
  nameList = ['BLUE', 'GREEN', 'RED', 'NIR', 'SWIR1', 'SWIR2', 'TEMP']
  subBand = ['BLUE', 'GREEN', 'RED', 'NIR', 'SWIR1', 'SWIR2']

  opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2)
  thermalBand = image.select('ST_B10').multiply(0.00341802).add(149.0)
  scaled = (opticalBands.addBands(thermalBand, null, true)

  validQA_AEROSOL = [2, 4, 32, 64, 66, 68, 96, 100, 128, 130, 132, 160, 164]
  validQA = [21824, 21888]

  mask1 = ee.Image(image).select(['QA_PIXEL']).remap(
      validQA, ee.List.repeat(1, len(validQA)), 0)
  // Saturated pixels
  mask2 = image.select('QA_RADSAT').eq(0)
  mask3 = scaled.select(subBand).reduce(ee.Reducer.min()).gt(0)
  mask4 = scaled.select(subBand).reduce(ee.Reducer.max()).lt(1)
  mask5 = ee.Image(image).select(['SR_QA_AEROSOL']).remap(
      SR_QA_AEROSOL, ee.List.repeat(1, len(SR_QA_AEROSOL)), 0)

  return (ee.Image(image).addBands(scaled)
  • Thank you for the code. If I understand your code correctly, you only consider values 21824 and 21888 in QA_PIXEL as "clear" pixels?
    – user88484
    Commented Jan 3 at 14:00
  • 1
    Correct. It's the most conservative of the various bit masks. Commented Jan 5 at 12:57

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.