1

I am trying to understand some of surface reflectance values in Landsat 5 and how to deal with (what I think is) saturation. Here is an example. If I look at and image for 23 October 1984, everything looks okay:

var ROI = ee.Geometry.Rectangle(24.68, 45.89,24.94,46.05);

function ScaleFactors_LS5_C2(image) {
  var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);
  var thermalBand = image.select('ST_B6').multiply(0.00341802).add(149.0);
  return image.addBands(opticalBands, null, true)
              .addBands(thermalBand, null, true);
}

var cloudMask457_C2 = function(image) {
  var dilatedCloud = (1 << 1)
  var cloud = (1 << 3)
  var cloudShadow = (1 << 4)
  var qa = image.select('QA_PIXEL');
  var mask = qa.bitwiseAnd(dilatedCloud)
    .and(qa.bitwiseAnd(cloud))
    .or(qa.bitwiseAnd(cloudShadow))
  return image.updateMask(mask.not());
}


var image = ee.ImageCollection('LANDSAT/LT05/C02/T1_L2')
    .filterDate('1984-10-01', '1984-10-25')
    .filterBounds(ROI)
  .map(cloudMask457_C2)
  .map(ScaleFactors_LS5_C2)
  .first()
  .clip(ROI);
    
var qaMask = image.select('QA_PIXEL')

var qaMask_params = {min: 0,max: 10}

var L457_C2params = {
  bands: ['SR_B3', 'SR_B2', 'SR_B1'],
  min: 0.0,
  max: 0.3
  }

Map.centerObject(image);
Map.addLayer(image, L457_C2params, 'True Color 3 2 1');
Map.addLayer(qaMask,qaMask_params);

However, if I change the dates to .filterDate('1984-04-01', '1984-04-29'), the resulting image looks like a mess, but the underlying QA_PIXEL values are the same for both images (5440). How does one either filter this image?

This is probably a very basic question, I just haven't ever encountered a lot of images like this. I have mainly worked with Landsat 5 after 1991.

1 Answer 1

1

You can see in the image metadata (by printing the image) that it's both not a very good image

IMAGE_QUALITY: 7

and that it's got saturation in most bands:

SATURATION_BAND_1: Y
SATURATION_BAND_2: Y
SATURATION_BAND_3: Y
SATURATION_BAND_4: Y
SATURATION_BAND_5: Y
SATURATION_BAND_6: N
SATURATION_BAND_7: Y

You can filter out such images with collection.filter(), e.g.:

ee.ImageCollection('LANDSAT/LT05/C02/T1_L2')
    .filter("IMAGE_QUALITY == 9")
    .filter("SATURATION_BAND_4 == 'N'")
2
  • Thanks. Now I am wondering if there is a way to generate a table from an image collection of the metadata. I am going to work on this and post as a new question if I can't figure it out.
    – user44796
    Commented Oct 17, 2022 at 12:44
  • You can simply cast the ImageCollection to a FeatureCollection and export it as a table. ImageCollections are just specialized versions of FeatureCollections. Commented Oct 17, 2022 at 16:07

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.