0

I am trying to filter low-cloud images from Landsat 8 or Path 39, Row 35 in GEE as part of a larger script to calculate LST around a solar farm.

I'm mid-way through exploring yet another approach and am adapting another persons script which didn't create a cloud mask for Landsat 8. The BQA band does this, but although I am able to identify low-cloud images using the 'CLOUD_COVER' value in metadata, for some images the BQA band seems to be missing and I get the error:

ImageCollection (Error) Error in map(ID=LC08_039035_20170611): Image.select: Pattern 'BQA' did not match any bands.

Am I doing something wrong? I thought Collection 1 data was complete? How should i handle images without the BQA band? I still need to mask clouds et al., but even if I knew how to do it mixing a method based on the BQA band with another approach.

An example scene would be LC08_L1TP_039035_20170118_20170218_01_T1 which isn't an SR product so I don't think this is a mistake regarding BQA/pixel_qa. I'm probably just doing this completely wrong!

var StatelineSolar = ee.Geometry.Polygon(
        [[[-115.50906528445387, 35.63597003699956],
          [-115.50906528445387, 35.528750545150906],
          [-115.36349643679762, 35.528750545150906],
          [-115.36349643679762, 35.63597003699956]]], null, false);

Map.centerObject(StatelineSolar, 14);

//cloud mask landsat8 based on the pixel_qa band of Landsat SR data.
var LC8_BANDS = ['B4',  'B5', 'B10', 'BQA']; //Landsat 8
var STD_NAMES = ['red', 'nir', 'temp', 'qa'];

//var cloudmasklandsat8= function(image){
//   var Qlandsat8= image.select('qa');
//    var cloudShadowBitMask = (1 << 3);
//   var cloudsBitMask = (1 << 5);
//    var mask5and7=Qlandsat5and7.clip(StatelineSolar).bitwiseAnd(cloudShadowBitMask).eq(0)
//                                   .and(Qlandsat5and7.bitwiseAnd(cloudsBitMask).eq(0));
//    return image.updateMask(mask5and7);
//};

var landsat8 = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR').select(LC8_BANDS, STD_NAMES)
                  .filterDate('2017-01-01', '2020-12-31')
                  .filterBounds(StatelineSolar)
                  .filter(ee.Filter.lt('CLOUD_COVER', 5))
                  .filter(ee.Filter.eq('WRS_PATH', 39))
                  .filter(ee.Filter.eq('WRS_ROW', 35))
//                    .filter(ee.Filter.lt('BQA',))
//                  .map(cloudmasklandsat7and5and8);


1
  • Sorry - Level 1, not Tier 1. Commented Jun 4, 2021 at 15:02

1 Answer 1

2

Surface reflectance images have different (more) QA bands than the TOA or RAW images. Printing one image shows the bands:

bands: List (12 elements)
0: "B1", signed int16, EPSG:32611, 7591x7731 px
1: "B2", signed int16, EPSG:32611, 7591x7731 px
2: "B3", signed int16, EPSG:32611, 7591x7731 px
3: "B4", signed int16, EPSG:32611, 7591x7731 px
4: "B5", signed int16, EPSG:32611, 7591x7731 px
5: "B6", signed int16, EPSG:32611, 7591x7731 px
6: "B7", signed int16, EPSG:32611, 7591x7731 px
7: "B10", signed int16, EPSG:32611, 7591x7731 px
8: "B11", signed int16, EPSG:32611, 7591x7731 px
9: "sr_aerosol", unsigned int8, EPSG:32611, 7591x7731 px
10: "pixel_qa", unsigned int16, EPSG:32611, 7591x7731 px
11: "radsat_qa", unsigned int16

This is documented in both the Earth Engine Dataset Description (https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C01_T1_SR#bands) as well as the Landsat Surface Reflectance Product User's Guide (https://prd-wret.s3.us-west-2.amazonaws.com/assets/palladium/production/atoms/files/LSDS-1368_L8_C1-LandSurfaceReflectanceCode-LASRC_ProductGuide-v3.pdf)

1
  • Thanks, @Noel Gorelick. I think I have become confused between the different products, and as such the documentation (which I've read) further muddies the waters. It's handy to know that SR images have more QA bands - I'll come back and try and answer this myself after a walk to clear my head. Commented Jun 4, 2021 at 15:29

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.