Published
Edited
Apr 23, 2021
1 fork
3 stars
Insert cell
Insert cell
md`### Landsat 8
<pre><code><strong>Sensors:</strong> <em>OLI</em> bands(1-9) and <em>TIRS</em> (bands 10-11)</code></pre>
<pre><code><strong>Spatial Resolution:</strong> bands 1-7,9 = <em>30m</em>. Band 8 = <em>15m</em>. Bands 10-11 = <em>100m</em></code></pre>
<pre><code><strong>Temporal Resolution:</strong> 16 Days</code></pre>
<pre><code><strong>Scene size:</strong> 185 km × 180 km </code></pre>
<pre><code><strong>Map Projection:</strong> UTM </code></pre>
`
Insert cell
md`### Acquiring Data:
Find a tile using https://search.remotepixel.ca.
Here's what we use in this dataset: https://landsatonaws.com/L8/045/032/LC08_L1TP_045032_20180811_20180815_01_T1
`
Insert cell
html`<img src="http://landsat-pds.s3.amazonaws.com/c1/L8/045/032/LC08_L1TP_045032_20180811_20180815_01_T1/LC08_L1TP_045032_20180811_20180815_01_T1_thumb_small.jpg" width="300">`
Insert cell
geoblaze = require('geoblaze@0.3.2')
Insert cell
md `### Band 5, NIR (Near Infrared), comprises wavelengths 0.851 - 0.879µm`
Insert cell
Insert cell
band5Raster = geoblaze.load(urlBand5)
Insert cell
band5Raster.noDataValue = 0;
Insert cell
band5Raster.toCanvas({width: 500, height: 500})
Insert cell
md`### Band 7, SWIR (Short-Wave Infrared) 2, comprises wavelengths 2.107 - 2.294 µm`
Insert cell
urlBand7 = "https://s3.amazonaws.com/geoblaze/LC08_L1TP_045032_20180811_20180815_01_T1_B7_100x100.TIF"
Insert cell
band7Raster = geoblaze.load(urlBand7)
Insert cell
band7Raster.noDataValue = 0;
Insert cell
band7Raster.toCanvas({width:500, height:500})
Insert cell
Insert cell
Insert cell
newValues = {
// we know each raster is only one band, so used index [0]
const band5Values = band5Raster.values[0];
const band7Values = band7Raster.values[0];
// we know height and width same between rasters
const { height, width } = band5Raster;
return [band5Values.map((band5Row, rowIndex) => {
const band7Row = band7Values[rowIndex];
// iterates through cells or columns in the current row
return band5Row.map((band5Value, band5ColumnIndex) => {
if (band5Value == band5Raster.noDataValue) {
return 999;
}
const band7Value = band7Row[band5ColumnIndex];
const R75 = band7Value / band5Value;
if (R75 > 0.25 && (band7Value - band5Value) > 0.3 && band7Value > 0.5) {
return 1;
} else {
return 0;
}
});
})];
};
Insert cell
parseGeoRaster = require("georaster@1.5.4")
Insert cell
newGeoRaster = {
const { height, pixelHeight, pixelWidth, width, xmin, xmax, ymin, ymax } = band5Raster;
const metadata = {
height,
noDataValue: 999,
pixelHeight,
pixelWidth,
width,
xmin,
xmax,
ymin,
ymax
};
return parseGeoRaster(newValues, metadata)
}
Insert cell
resultCanvas = newGeoRaster.toCanvas({ height: 500, width: 500 })
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
md`#### You can read more about the algorithm utilized here: Wilfrid Schroeder, Patricia Oliva, Louis Giglio et al. Active fire detection using Landsat-8/OLI data
https://doi.org/10.1016/j.rse.2015.08.032.
(http://www.sciencedirect.com/science/article/pii/S0034425715301206)`
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more