Define The Custom Polygon For The
Define The Custom Polygon For The
function cloudMask(image) {
// Define cloud shadow and cloud bitmasks (Bits 3 and 5)
var cloudShadowBitmask = (1 << 3);
var cloudBitmask = (1 << 5);
// Select the Quality Assessment (QA) band for pixel quality information
var qa = image.select('QA_PIXEL');
// Create a binary mask to identify clear conditions (both cloud and cloud shadow
bits set to 0)
var mask = qa.bitwiseAnd(cloudShadowBitmask).eq(0)
.and(qa.bitwiseAnd(cloudBitmask).eq(0));
// Update the original image, masking out cloud and cloud shadow-affected pixels
return image.updateMask(mask);
}
// Add the processed image to the map with the specified visualization
Map.addLayer(image, visualization, 'True Color 432');
// Calculate the Fraction of Vegetation (FV) using the NDVI values within the
specified range.
// NDVI_min represents the minimum NDVI value, and NDVI_max represents the maximum
NDVI value
var fv = ((ndvi.subtract(ndviMin)).divide(ndviMax.subtract(ndviMin)))
.pow(ee.Number(2))
.rename('FV');
// Emissivity Calculation
// Formula: 0.004 * FV + 0.986
// Calculate Land Surface Emissivity (EM) using the Fraction of Vegetation (FV).
// The 0.004 coefficient represents the emissivity variation due to vegetation,
// and the 0.986 represents the base emissivity for other surfaces.
var em = fv.multiply(ee.Number(0.004)).add(ee.Number(0.986)).rename('EM');
// Add the LST Layer to the Map with Custom Visualization Parameters
Map.addLayer(lst, {
min: 18.47, // Minimum LST value
max: 42.86, // Maximum LST value
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'
]}, 'Land Surface Temperature 2024');