Google Earth Engine – Analyzing TOA for Landsat 8 Images Using GEE

google-earth-engine

I am trying to create at-sensor albedo for image collection of Landsat 8 for the year 2021. I created a function for that with applying ee.Algorithms.Landsat.TOA. But the error occurs:

TOA: Layer error: ImageCollection.mosaic: Error in map: Landsat.TOA: Band 'B1' is Type Float, expected Type<Integer<0, 65535>>.

function addtoa(image) {
  
  var toa = ee.Algorithms.Landsat.TOA(image);
  
  return image.addBands(toa);
}

var filtered = filtered.map(addtoa);
Map.addLayer(filtered, {}, 'TOA');

I am using LANDSAT/LC08/C02/T1_TOA collection.

Best Answer

This occurs because you are using the wrong dataset. It must be LANDSAT/LC08/C02/T1 instead LANDSAT/LC08/C02/T1_TOA collection.

Documentation for ee.Algorithms.Landsat.TOA(input) says:

Calibrates Landsat DN to TOA reflectance and brightness temperature for Landsat and similar data. For recently-acquired scenes calibration coefficients are extracted from the image metadata; for older scenes the coefficients are derived from:

Chander, Gyanesh, Brian L. Markham, and Dennis L. Helder. "Summary of current radiometric calibration coefficients for Landsat MSS, TM, ETM+, and EO-1 ALI sensors." Remote sensing of environment 113.5 (2009): 893-903.

So, if you try:

var dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1')
                  .filterDate('2021-01-01', '2022-01-01');

Map.setCenter(55.961, 25.698);

function addtoa(image) {
  
  var toa = ee.Algorithms.Landsat.TOA(image);
  
  return image.addBands(toa);
}

var filtered = dataset.map(addtoa);
Map.addLayer(filtered, {}, 'TOA');

you will get the following result:

enter image description here