Spaces:
Runtime error
Runtime error
Download scripts/ndmi.js from DeepFundingAgriAI/Field-Monitoring: direct link, hf CLI and curl.
- Browser
- Download file 511 Bytes
-
https://huggingface.co/spaces/DeepFundingAgriAI/Field-Monitoring/resolve/a17d0248fca618bc8a2d02c0dd65511d9857e85b/scripts/ndmi.js
- Command line
-
hf download hf://spaces/DeepFundingAgriAI/Field-Monitoring@a17d0248fca618bc8a2d02c0dd65511d9857e85b/scripts/ndmi.js
-
curl -L -o ndmi.js https://huggingface.co/spaces/DeepFundingAgriAI/Field-Monitoring/resolve/a17d0248fca618bc8a2d02c0dd65511d9857e85b/scripts/ndmi.js
511 Bytes
| //VERSION=3 | |
| const moistureRamps = [ | |
| [-0.8, 0x800000], | |
| [-0.24, 0xff0000], | |
| [-0.032, 0xffff00], | |
| [0.032, 0x00ffff], | |
| [0.24, 0x0000ff], | |
| [0.8, 0x000080] | |
| ]; | |
| const viz = new ColorRampVisualizer(moistureRamps); | |
| function setup() { | |
| return { | |
| input: ["B8A", "B11", "dataMask"], | |
| output: { bands: 4 } | |
| }; | |
| } | |
| function evaluatePixel(samples) { | |
| let val = index(samples.B8A, samples.B11); | |
| let imgVals = viz.process(val); | |
| return imgVals.concat(samples.dataMask); | |
| } |