-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update SkySat scripts #309
base: main
Are you sure you want to change the base?
Conversation
|
||
function evaluatePixel(sample) { | ||
let NDVI = index(sample.NIR, sample.Red); | ||
const indexVal = sample.dataMask === 1 ? NDVI : NaN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mask infinite value as well. For example:
const indexVal = isFinite(NDVI) && sample.dataMask === 1 ? NDVI : NaN;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some comments for minor changes
function evaluatePixel(sample) { | ||
let NDVI = index(sample.NIR, sample.Red); | ||
const indexVal = sample.dataMask === 1 ? NDVI : NaN; | ||
let id_default = valueInterpolate(NDVI, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove the dataMask in the valueInterpolate
and include the dataMask later. In this case we can avoid repeatation.
); | ||
|
||
return { | ||
default: id_default, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include dataMask as the following:
default: id_default.concat(sample.dataMask),
|
||
function setup() { | ||
return { | ||
input: ["Red", "NIR", "dataMask"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataMask can be removed
var NDVI = index(sample.nir, sample.red) | ||
return valueInterpolate(NDVI, | ||
let NDVI = index(sample.NIR, sample.Red); | ||
let id_default = valueInterpolate(NDVI, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the eob script. I would remove the dataMask from valueInterpolate
function and include dataMask later
]); | ||
|
||
return { | ||
default: id_default, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return {
default: id_default.concat(sample.dataMask),
};
Updated / added the NDVI scripts
script.js
which contains "normal" visualization without additional outputs needed for EO Browser statistics and histogrameob.js
which contains additional outputs needed for EO Browser statistics and histogramraw.js
which just outputs raw NDVI values