-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheval_scripts.py
More file actions
38 lines (34 loc) · 923 Bytes
/
eval_scripts.py
File metadata and controls
38 lines (34 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
TRUE_IMAGE_EVAL_SCRIPT = """
//VERSION=3
function setup() {
return {
input: [{
bands: ["B02", "B03", "B04"]
}],
output: {
bands: 3
}
};
}
function evaluatePixel(sample) {
return [sample.B04, sample.B03, sample.B02];
}
"""
SAR1_EVAL_SCRIPT = """function setup() {
return {
input: ["VV", "dataMask"],
output: [
{ id: "default", bands: 4 },
{ id: "eobrowserStats", bands: 1 },
{ id: "dataMask", bands: 1 },
],
};
}
function evaluatePixel(samples) {
const value = Math.max(0, Math.log(samples.VV) * 0.21714724095 + 1);
return {
default: [value, value, value, samples.dataMask],
eobrowserStats: [Math.max(-30, (10 * Math.log10(samples.VV)))],
dataMask: [samples.dataMask],
};
}"""