-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #293 from sentinel-hub/feat/pvs-multi-script
Added multi script support to remaining pvs
- Loading branch information
Showing
9 changed files
with
124 additions
and
120 deletions.
There are no files selected for viewing
62 changes: 32 additions & 30 deletions
62
planetary-variables/crop-biomass/crop-biomass-visualization/eob.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,44 @@ | ||
//VERSION=3 | ||
// To set custom max and min values, set | ||
// defaultVis to false and choose your max and | ||
// min values. The color map will then be scaled | ||
// to those max and min values | ||
function setup() { | ||
return { | ||
input: ["CB", "dataMask"], | ||
output: [ | ||
{ id: "default", bands: 4 }, | ||
{ id: "index", bands: 1, sampleType: 'FLOAT32' }, | ||
{ id: "eobrowserStats", bands: 1, sampleType: 'FLOAT32' }, | ||
{ id: "dataMask", bands: 1 } | ||
] | ||
}; | ||
return { | ||
input: ["CB", "dataMask"], | ||
output: [ | ||
{ id: "default", bands: 4 }, | ||
{ id: "index", bands: 1, sampleType: "FLOAT32" }, | ||
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" }, | ||
{ id: "dataMask", bands: 1 }, | ||
], | ||
}; | ||
} | ||
|
||
|
||
const bp_ramp = [ | ||
[0, 0xfff7ea], | ||
[0.100, 0xf3e3c8], | ||
[0.200, 0xdad0a4], | ||
[0.300, 0xbdc082], | ||
[0.400, 0x99b160], | ||
[0.500, 0x6da242], | ||
[0.600, 0x2c952e], | ||
[0.7000, 0x008729], | ||
[0.800, 0x007932], | ||
[0.9000, 0x006640], | ||
[1.000, 0x005444], | ||
[0, 0xfff7ea], | ||
[0.1, 0xf3e3c8], | ||
[0.2, 0xdad0a4], | ||
[0.3, 0xbdc082], | ||
[0.4, 0x99b160], | ||
[0.5, 0x6da242], | ||
[0.6, 0x2c952e], | ||
[0.7, 0x008729], | ||
[0.8, 0x007932], | ||
[0.9, 0x006640], | ||
[1.0, 0x005444], | ||
]; | ||
|
||
const visualizer = new ColorRampVisualizer(bp_ramp); | ||
|
||
let factor = 1 / 1000; | ||
function evaluatePixel(sample) { | ||
let val = sample.CB * factor; | ||
let imgVals = visualizer.process(val); | ||
return { | ||
default: [...imgVals, sample.dataMask], | ||
index: [val], | ||
eobrowserStats: [val], | ||
dataMask: [sample.dataMask] | ||
}; | ||
let val = sample.CB * factor; | ||
let imgVals = visualizer.process(val); | ||
return { | ||
default: [...imgVals, sample.dataMask], | ||
index: [val], | ||
eobrowserStats: [val], | ||
dataMask: [sample.dataMask], | ||
}; | ||
} | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ function setup() { | |
} | ||
|
||
function evaluatePixel(sample) { | ||
return [sample.ACD] | ||
return [sample.ACD]; | ||
} |
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
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
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
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
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
Oops, something went wrong.