diff --git a/_layouts/script.html b/_layouts/script.html index 644f6189..8cc55d3a 100644 --- a/_layouts/script.html +++ b/_layouts/script.html @@ -17,6 +17,7 @@ S1_AWS_EW_HHHV: S1_CDAS_EW_HHHV S1_MOSAIC: 3c662330-108b-4378-8899-525fd5a225cb DEM_MAPZEN: DEM_COPERNICUS_30_CDAS + AWS_LOTL1: CDAS_L8_L9_LOTL1 --- diff --git a/landsat-8/landsat-8.md b/landsat-8/landsat-8.md index d49886b3..f2896ae6 100644 --- a/landsat-8/landsat-8.md +++ b/landsat-8/landsat-8.md @@ -41,4 +41,5 @@ The Landsat program is the longest running enterprise for acquisition of satelli - [Pansharpened true color](/landsat-8/true-color-pansharpened) - [Thermal visualization](/landsat-8/thermal) - [Thermal FLIR visualization](/landsat-8/thermal-iron) - - [Band quality assessment band visualization](/landsat-8/bqa) \ No newline at end of file + - [Band quality assessment band visualization](/landsat-8/bqa) + - [Markuse fire](/landsat-8/markuse_fire_landsat) \ No newline at end of file diff --git a/landsat-8/markuse_fire_landsat/README.md b/landsat-8/markuse_fire_landsat/README.md new file mode 100644 index 00000000..433ce5be --- /dev/null +++ b/landsat-8/markuse_fire_landsat/README.md @@ -0,0 +1,56 @@ +--- +title: Markuse fire +parent: Landsat 8 +grand_parent: Landsat +layout: script +permalink: /landsat-8/markuse_fire_landsat/ +nav_exclude: true +examples: +- zoom: '12' + lat: '32.75754' + lng: '-16.96598' + datasetId: AWS_LOTL1 + fromTime: '2024-08-17T00:00:00.000Z' + toTime: '2024-08-17T23:59:59.999Z' + platform: + - CDSE + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/landsat-8/markuse_fire_landsat/script.js +--- + +## General description + +This script highlights **active fire** on Landsat 8/9 imagery by combining a true-color base with an +intensified thermal glow. This script is based on the algorithm developed for wildfire monitoring by +Pierre Markuse, enhancing the thermal signal from the Landsat thermal bands instead of the SWIR bands +of Sentinel-2 (see the original [Markuse fire script](/sentinel-2/markuse_fire) for Sentinel-2). + +The visualization is built in three steps: + +1. **Thermal normalization** — the thermal band **B10** is converted to a temperature in degrees + Celsius. The script accepts B10 in different scalings: already-Celsius/Kelvin values, scaled digital + numbers, or raw values, which are converted to brightness temperature using the Landsat TIRS + calibration constants (`K1 = 774.8853`, `K2 = 1321.0789`). +2. **True-color base** — a slightly darkened true color image (`B04`, `B03`, `B02`) provides the + geographic context and improves the contrast of the fire glow. +3. **Intensified fire glow** — where the temperature exceeds `minFireC` (45 °C), an additive + red→yellow→white glow is blended onto the base. The intensity ramps up to `maxFireC` (115 °C) for the + white-hot core. `Math.pow` curves keep the glow deep red for moderate heat and reserve yellow and + white for the most intense pixels. + +You can tune the `minFireC` and `maxFireC` thresholds at the top of the script to adjust the sensitivity +of the glow. Note this is a **per-pixel** script (Sentinel Hub evalscripts have no access to neighbouring +pixels), so it visualizes thermal anomalies but does not measure or cluster them — that kind of spatial +analysis is a downstream step. + +## Description of representative images + +Wildfire on the island of Madeira (Portugal), acquired 2024-08-17. The active fire fronts glow red to +white-hot over the darkened true-color terrain. + +![Intensified fire glow over Madeira](fig/fig1.png) + +## References + +- Original Sentinel-2 visualization: [Markuse fire script](/sentinel-2/markuse_fire) by Pierre Markuse +- Landsat 8 bands: [Landsat 8 collection](/landsat-8/) +- Custom scripts evalscript reference: [Evalscript V3](https://docs.sentinel-hub.com/api/latest/evalscript/v3/) diff --git a/landsat-8/markuse_fire_landsat/fig/fig1.png b/landsat-8/markuse_fire_landsat/fig/fig1.png new file mode 100644 index 00000000..a03995a9 Binary files /dev/null and b/landsat-8/markuse_fire_landsat/fig/fig1.png differ diff --git a/landsat-8/markuse_fire_landsat/script.js b/landsat-8/markuse_fire_landsat/script.js new file mode 100644 index 00000000..e93944bd --- /dev/null +++ b/landsat-8/markuse_fire_landsat/script.js @@ -0,0 +1,59 @@ +//VERSION=3 +// Landsat 8/9 Intensified Fire Glow Script +// Based on the Pierre Markuse wildfire script, edited using AI by András Zlinszky, Sinergise + +function setup() { + return { + input: ["B02", "B03", "B04", "B10", "dataMask"], + output: { bands: 3 } + }; +} + +function evaluatePixel(sample) { + if (sample.dataMask === 0) return [0, 0, 0]; + + // 1. DATA NORMALIZATION (B10 -> Celsius) + var b10 = sample.B10; + var LST_C = 0; + if (b10 > 200) { + LST_C = (b10 > 1000) ? (b10 * 0.1) - 273.15 : b10 - 273.15; + } else { + var K1 = 774.8853; + var K2 = 1321.0789; + LST_C = (K2 / Math.log(K1 / (b10 + 0.0001) + 1)) - 273.15; + } + + // 2. TRUE COLOR BASE (Slightly darkened for better contrast with fire) + var brightness = 1.8; + var R = sample.B04 * brightness; + var G = sample.B03 * brightness; + var B = sample.B02 * brightness; + + // 3. INTENSE FIRE PARAMETERS + var minFireC = 45; // Threshold to start the red glow + var maxFireC = 115; // Threshold for white-hot center + + if (LST_C > minFireC) { + // Normalize heat value + var val = (LST_C - minFireC) / (maxFireC - minFireC); + val = Math.min(Math.max(val, 0), 1); + + // --- INTENSIFIED RED GLOW LOGIC --- + // We use Math.pow to create a steep curve. + // Deep Red starts early; Yellow/White only appears at very high temps. + + var redIntensifier = val * 2.5; // Strong red base + var yellowIntensifier = Math.pow(val, 3); // Yellow kicks in late (intense heat) + var whiteIntensifier = Math.pow(val, 5); // White only for the core + + // Apply colors using an additive blend (Screen-like effect) + R = R + redIntensifier; + G = G + (yellowIntensifier * 0.8) + (whiteIntensifier * 0.5); + B = B + (whiteIntensifier * 0.8); + + // Optional: Add a slight "bloom" to the red channel + R *= 1.2; + } + + return [R, G, B]; +}