I met some doubts when I try to extract Landsat surface reflection product's atmosphere opacity.

the code is :

var inCollection7 = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR").filter(ee.Filter.calendarRange(2016,2018,'year')).filter(ee.Filter.calendarRange(6,8,'month')).filterBounds(geometry);

var list=inCollection7.toList(10)

var test_img7= ee.Image(list.get(0))



the question is :

  1. why the Landsat7's atmosphere opacity' value is not from 0 to 0.3 or more(like the data description)?

data description


  • Welcome to GIS SE! We're a little different from other sites. We're a Q&A site, not a discussion forum. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. Please check out our short tour where you will see that there should be only one question asked per question. – PolyGeo Mar 30 '19 at 5:49
  • Please copy and paste your code and properly format it rather than providing a link or screenshot to the code. That way if the url goes 404 the code is still preserved. – Aaron Apr 1 '19 at 4:36

After sr_atmos_opacity it says 0.001, that is the scale. So, you have to multiply the value by the scale to get the actual value.

var inCollection7 = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR")
                       .filterMetadata('CLOUD_COVER', 'greater_than', 80)

var list=inCollection7.toList(10)

var test_img7= ee.Image(list.get(0))


var getClass = function(image, lowerLimit, upperLimit, newValue) {
  var mask = image.gte(lowerLimit).and(image.lt(upperLimit))
  return mask.multiply(newValue)

var atm = test_img7.select('sr_atmos_opacity').multiply(0.001)

var clear = getClass(atm, -32, 0.1, 0)
var average = getClass(atm, 0.1, 0.3, 1)
var hazy = getClass(atm, 0.31, 32, 2)

var clas = clear.add(average).add(hazy).rename('class')

Map.addLayer(clas,{min:0, max:2, palette:['blue', 'green', 'gray']}, 'atmos opacity')
Map.addLayer(test_img7 ,{bands:['B4', 'B5', 'B3'], min:0, max:5000}, 'img', false)

link: https://code.earthengine.google.com/d508bb32c4b61001a3f412f862a5fed2

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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