Skip to content

Commit d879748

Browse files
Automatic formatting of scripts
1 parent 9acc649 commit d879748

File tree

5 files changed

+74
-72
lines changed

5 files changed

+74
-72
lines changed

Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://rubygems.org'
2-
gem "github-pages", "~> 228", group: :jekyll_plugins
3-
gem "just-the-docs", "0.4.2"
2+
gem "github-pages", "231", group: :jekyll_plugins
3+
gem "just-the-docs", "0.8.2"
44
gem "webrick"
55
gem "rake"
6+
gem "jekyll", "3.9.5"
67
gem "html-proofer", git: "https://github.com/jonasViehweger/html-proofer"
Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
//VERSION=3
22
function setup() {
33
return {
4-
input: [{
5-
datasource: "S2L2A",
6-
bands: ["B08"]
7-
},
8-
{
9-
datasource: "S1GRD",
10-
bands: ["VV", "dataMask"]
11-
}
12-
],
13-
output: { bands: 4 },
14-
mosaicking: "SIMPLE"
4+
input: [
5+
{
6+
datasource: "S2L2A",
7+
bands: ["B08"],
8+
},
9+
{
10+
datasource: "S1GRD",
11+
bands: ["VV", "dataMask"],
12+
},
13+
],
14+
output: { bands: 4 },
15+
mosaicking: "SIMPLE",
1516
};
16-
}
17-
18-
function toDB(input){
19-
return 10 * Math.log(input) / Math.LN10;
20-
}
21-
17+
}
18+
19+
function toDB(input) {
20+
return (10 * Math.log(input)) / Math.LN10;
21+
}
22+
2223
//threshold value for water detection, reduce for more water, increase for less water
2324
const lim = 15;
2425
//gain value for image brightness (increase for brighter image)
2526
const f = 2.5;
26-
27+
2728
function evaluatePixel(sample) {
28-
var S1 = sample.S1GRD[0];
29-
var S2 = sample.S2L2A[0];
30-
if (toDB(S1.VV) <= -1 * lim){
31-
return [S1.VV * 10, S1.VV * 10 , S1.VV * 50, 1];
32-
} else {
33-
return [f * S2.B08,f * S2.B08, f * S2.B08,1]
34-
}
35-
}
29+
var S1 = sample.S1GRD[0];
30+
var S2 = sample.S2L2A[0];
31+
if (toDB(S1.VV) <= -1 * lim) {
32+
return [S1.VV * 10, S1.VV * 10, S1.VV * 50, 1];
33+
} else {
34+
return [f * S2.B08, f * S2.B08, f * S2.B08, 1];
35+
}
36+
}
Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
//VERSION=3
22
function setup() {
33
return {
4-
input: [{
5-
datasource: "CUSTOM",
6-
bands: ["B02", "B03", "B04"]
7-
},
8-
{
9-
datasource: "S1GRD",
10-
bands: ["VV", "VH", "dataMask"]
11-
}
12-
],
13-
output: { bands: 4 },
14-
mosaicking: "SIMPLE"
4+
input: [
5+
{
6+
datasource: "CUSTOM",
7+
bands: ["B02", "B03", "B04"],
8+
},
9+
{
10+
datasource: "S1GRD",
11+
bands: ["VV", "VH", "dataMask"],
12+
},
13+
],
14+
output: { bands: 4 },
15+
mosaicking: "SIMPLE",
1516
};
16-
}
17-
18-
function toDB(input){
19-
return 10 * Math.log(input)/Math.LN10;
20-
}
21-
//threshold value for water detection, reduce for more water, increase for less water
22-
const lim = 15;
23-
//gain value for image brightness (increase for brighter image)
24-
const f = 0.0008;
25-
26-
function evaluatePixel(sample) {
17+
}
18+
19+
function toDB(input) {
20+
return (10 * Math.log(input)) / Math.LN10;
21+
}
22+
//threshold value for water detection, reduce for more water, increase for less water
23+
const lim = 15;
24+
//gain value for image brightness (increase for brighter image)
25+
const f = 0.0008;
26+
27+
function evaluatePixel(sample) {
2728
var S1 = sample.S1GRD[0];
2829
var S2 = sample.CUSTOM[0];
29-
if (toDB(S1.VV) <= -1*lim){
30-
return [S1.VV * 10, S1.VV * 10 , S1.VV * 50, 1];
30+
if (toDB(S1.VV) <= -1 * lim) {
31+
return [S1.VV * 10, S1.VV * 10, S1.VV * 50, 1];
3132
} else {
32-
return [f*S2.B04,f*S2.B03, f*S2.B02,1]
33+
return [f * S2.B04, f * S2.B03, f * S2.B02, 1];
3334
}
34-
}
35+
}

sentinel1-monthly-mosaic/rgb_ratio/readme.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ examples:
2525

2626
## General description of the script
2727

28-
RGB ratio
29-
3028
This script combines the gamma0 of the VV and VH polarizations into a false color visualization. It uses the VV polarization in the red channel, the VH polarization in the green channel, and a ratio of VH/VV in the blue channel. It shows water areas in dark red (black), urban areas in yellow, vegetated areas in turquoise, and bare ground in dark purple.
3129

3230
For snowy and icy areas, the visualization can vary from light yellow to blue to red. In order not to confuse cryogenic features with non-cryogenic ones, some general information about the location is helpful in interpreting the image.
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
//VERSION=3
22
function setup() {
33
return {
4-
input: ["VV", "VH", "dataMask"],
5-
output: { bands: 3 }
4+
input: ["VV", "VH", "dataMask"],
5+
output: { bands: 3 },
66
};
7-
}
8-
9-
var viz = new HighlightCompressVisualizer(0, 0.8);
10-
var gain = 0.8;
11-
12-
13-
function evaluatePixel(sample) {
7+
}
8+
9+
var viz = new HighlightCompressVisualizer(0, 0.8);
10+
var gain = 0.8;
11+
12+
function evaluatePixel(sample) {
1413
if (sample.dataMask == 0) {
15-
return [0, 0, 0];
14+
return [0, 0, 0];
1615
}
17-
18-
let vals = [gain * sample.VV / 0.28,
19-
gain * sample.VH / 0.06,
20-
gain * sample.VH / sample.VV / 0.49];
21-
16+
17+
let vals = [
18+
(gain * sample.VV) / 0.28,
19+
(gain * sample.VH) / 0.06,
20+
(gain * sample.VH) / sample.VV / 0.49,
21+
];
22+
2223
return viz.processList(vals);
23-
}
24+
}

0 commit comments

Comments
 (0)