Last active
March 15, 2023 10:52
-
-
Save twei55/09efd83177bdcb9fbf61ad46b8291612 to your computer and use it in GitHub Desktop.
Custom script to calculate FDI (Floating Debris Index) in EO-Browser (Advanced version)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Calculation of Floating Debris Index (FDI) | |
For more information see https://www.nature.com/articles/s41598-020-62298-z | |
*/ | |
// S-2A Central Wavelength (nm) | |
const waveLengthRed = 664.6 | |
const waveLengthNIR = 832.8 | |
const waveLengthSWIR = 1613.7 | |
const FDI = B08 - (B06 + (B11 - B06) * ((waveLengthNIR - waveLengthRed)/(waveLengthSWIR - waveLengthRed)) * 10) | |
// https://docs.sentinel-hub.com/api/latest/evalscript/functions/#index | |
// Calculate difference divided by sum | |
const NDVI = index(B08, B04) | |
const FDIMask = 0.02 > FDI < 0.07 | |
const NDVIMask = 0.01 > NDVI < 0.25 | |
return [FDIMask * NDVIMask] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment