0

I'm trying to write a code for Land Surface Temperature (LST) from Landsat 8 images in the google earth engine. I have successfully calculated the following steps, NDVI, fractional vegetation (fv), emissivity (EM), and Brightness temperature (BT) is already calculated band in the Landsat image. I wrote an equation for LST. It was successfully executed. But when I download the resulting image it shows a range between 55 to 66 degrees. This range kills every living thing. What to do now any suggestions? Code link is given below: https://code.earthengine.google.com/82b3fce33d39235e9812c73386e3e725

//vis params
var vizParams = {
  bands: ['B5', 'B6', 'B4'],
  min: 642,
  max: 3307,
  gamma: [1, 0.9, 1.1]
};

var vizParams2 = {
  bands: ['B4', 'B3', 'B2'],
  min: 0,
  max: 3000,
  gamma: 1.4,
};

//RADIANCE_MULT_BAND_6_VCID_2: 0.03720499947667122
//RADIANCE_ADD_BAND_6_VCID_2: 3.1628000736236572
//load the collection:
{
var col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA').filterMetadata ('CLOUD_COVER', 'less_than', 5)
    .filterDate('2020-01-01','2020-12-31')
    .filterBounds(geometry)
    .map(function(image){return image.clip(geometry)});
}


print('collection', col);

Map.addLayer(col.first());

Map.centerObject(geometry)
//imagen reduction

var image = col.median();
//print('image', image);

//Map.addLayer(image, vizParams2);

//median
var ndvi1 = image.normalizedDifference(['B5', 'B4']).rename('NDVI');
var ndviParams = {min: 0.10554729676864096, max: 0.41295681063122924, palette: ['blue', 'white', 'green']};

//print('ndvi1', ndvi1);

//individual LST images

var col_list = col.toList(col.size());

var LST_col = col_list.map(function (ele) {
  
  var date = ee.Image(ele).get('system:time_start');

  var ndvi = ee.Image(ele).normalizedDifference(['B5', 'B4']).rename('NDVI');
  
  // find the min and max of NDVI
  var min = ee.Number(ndvi.reduceRegion({
    reducer: ee.Reducer.min(),
    geometry: geometry,
    scale: 30,
    maxPixels: 1e9,
    bestEffort:true
  }).values().get(0));
  
  var max = ee.Number(ndvi.reduceRegion({
    reducer: ee.Reducer.max(),
    geometry: geometry,
    scale: 30,
    maxPixels: 1e9
  }).values().get(0));
  
  var fv = (ndvi.subtract(min).divide(max.subtract(min))).pow(ee.Number(2)).rename('FV');
  
  var a= ee.Number(0.004);
  var b= ee.Number(0.986);
  
  var EM = fv.multiply(a).add(b).rename('EMM');

  var image = ee.Image(ele);

  var Tb = image.expression(
    '1282.7099609375 / log ((666.0900268554688/(0.03720499947667122*L + 3.1628000736236572)) + 1 )', {
    'L': image.select('B10')
  });

  var LST = image.expression(
    '(Tb/(1 + (0.00115* (Tb / 1.438))*log(Ep)))-273.15', {
      'Tb': Tb,
      'Ep': fv.multiply(a).add(b)
  });

  return ee.Algorithms.If(min, LST.set('system:time_start', date).float().rename('LST'), 0);

}).removeAll([0]);

LST_col = ee.ImageCollection(LST_col);

print("LST_col", LST_col);

/////////////////

//Map.addLayer(ndvi1, ndviParams, 'ndvi');

//select thermal band 10(with brightness tempereature), no calculation 
var thermal= image.select('B10').multiply(0.1);

var b10Params = {min: 200, max: 400, palette: ['blue', 'white', 'green']};

//Map.addLayer(thermal, b10Params, 'thermal');

// find the min and max of NDVI
var min = ee.Number(ndvi1.reduceRegion({
  reducer: ee.Reducer.min(),
  geometry: geometry,
  scale: 30,
  maxPixels: 1e9
}).values().get(0));

//print('min', min );

var max = ee.Number(ndvi1.reduceRegion({
  reducer: ee.Reducer.max(),
  geometry: geometry,
  scale: 30,
  maxPixels: 1e9
}).values().get(0));

//print('max', max);

//fractional vegetation
var fv = (ndvi1.subtract(min).divide(max.subtract(min))).pow(ee.Number(2)).rename('FV'); 

//print('fv', fv);

//Map.addLayer(fv);

//Emissivity
var a= ee.Number(0.004);
var b= ee.Number(0.986);
var EM = fv.multiply(a).add(b).rename('EMM');

var imageVisParam3 = {min: 0.9865619146722164, max:0.989699971371314};

//Map.addLayer(EM, imageVisParam3,'EMM');

//LST in Celsius Degree bring -273.15
//NB: In Kelvin don't bring -273.15
var LST = col.map(function (image){

  var date = image.get('system:time_start');
  
  var LST = image.expression(
    '(Tb/(1 + (0.00115* (Tb / 1.438))*log(Ep)))-273.15', {
    'Tb': thermal.select('B10'),
    'Ep':EM.select('EMM')
  }).float().rename('LST');
  
  return LST.set('system:time_start', date);
  
});

//print(LST);

Map.addLayer(LST, { palette: [
'040274', '040281', '0502a3', '0502b8', '0502ce', '0502e6',
'0602ff', '235cb1', '307ef3', '269db1', '30c8e2', '32d3ef',
'3be285', '3ff38f', '86e26f', '3ae237', 'b5e22e', 'd6e21f',
'fff705', 'ffd611', 'ffb613', 'ff8b13', 'ff6e08', 'ff500d',
'ff0000', 'de0101', 'c21301', 'a71001', '911003'
]},'LST');

print(
      ui.Chart.image.series({
        imageCollection: LST_col, 
        region: geometry, 
        reducer: ee.Reducer.mean(),
        scale: 30, // nominal scale Landsat imagery
        xProperty: 'system:time_start' // default
      }));

//export NDMI
/* 
var export_Collection = LST_col.select (['LST']).toBands();
// As a "flattened" image
print("export_Collection map", export_Collection);
Export.image.toDrive ({
   image: export_Collection, 
   description: 'LST_collection', 
   scale: 30,
   region: geometry,
  maxPixels:1e13
}); 
*/
// As a reduced Image
var export_Image = LST_col.reduce(ee.Reducer.mean());
print("export_Image map", export_Image);
Export.image.toDrive ({
   image: export_Image, 
   description: 'LST_image', 
   scale: 30,
   region: geometry,
  maxPixels:1e13
  
}); 

enter image description here

1 Answer 1

3

You have three products tagged with landsat-8 in Google Earth Engine:

https://developers.google.com/earth-engine/datasets/catalog/landsat-8

If you use the product "LANDSAT/LC08/C02/T1_L2", ST_B10 band is LST expressed in Kelvin degrees. You don't need to do any calculation. On the other hand, by using the product "LANDSAT/LC08/C02/T1", you can employ the procedure expressed in this reference for getting brightness temperature.

However, you are using the 'LANDSAT/LC08/C02/T1_TOA' product where it was calibrated as top-of-atmosphere (TOA) reflectance. In this case, you get directly brightness temperature (Tb) from thermal band and you only need correction factors for transforming Tb in LST. This correction factors can be found in page 5 of this Spanish reference.

With following code:

var col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
    .filterMetadata ('CLOUD_COVER', 'less_than', 5)
    .filterDate('2020-01-01','2020-12-31')
    .filterBounds(geometry)
    .map(function(image){return image.clip(geometry)});
    
print(col);

Map.addLayer(geometry);
Map.centerObject(geometry);

var col_list = col.toList(col.size());

var getTemp = col_list.map(function (image){
  
  var Tb = ee.Image(image).select('B10')
                          .subtract(273.15)
                          .rename('Tb');
  
  return Tb;
  
});

print(getTemp);


var imageVisParam = {"opacity":1,
                     "bands":["Tb"],
                     "min":15.612756347656273,
                     "max":31.650231933593773,
                     "palette":['040274', '040281', '0502a3', '0502b8', '0502ce', '0502e6',
                                '0602ff', '235cb1', '307ef3', '269db1', '30c8e2', '32d3ef',
                                '3be285', '3ff38f', '86e26f', '3ae237', 'b5e22e', 'd6e21f',
                                'fff705', 'ffd611', 'ffb613', 'ff8b13', 'ff6e08', 'ff500d',
                                'ff0000', 'de0101', 'c21301', 'a71001', '911003']};

Map.addLayer(ee.Image(getTemp.get(0)), imageVisParam, 'Tb');

you can corroborate that thermal band has Tb values between 15 and 32 Celsius degrees (won't kill every living thing) for an arbitrary geometry in Pakistan (your asset is not shareable). You only have to modify above getTemp function for LST determination.

I got following result after running above script in GEE code editor. A temperature value of about 17 Celsius degrees was obtained when I click in an arbitrary point corresponding to a cold area (blue color).

enter image description here

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.