Skip to content

Commit d14766e

Browse files
authored
Adding water surface visualizer to the sentinel 2 custom scripts repo (sentinel-hub#217)
* Create placeholder * Delete sentinel-2/kNDVI directory * Create p * Add files via upload * Create README.md * Update README.md * Create script.js * Create temp * Delete sentinel-2/water surface visualizer directory * Create temp * Create script.js * Add files via upload * Update and rename README.md.txt to README.md * Update README.md * Create dd * Add files via upload * Delete dd * Delete temp * Update README.md * Delete sentinel-2/kndvi directory
1 parent 915e92a commit d14766e

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Water Surface Visualizer
2+
<a href="#" id='togglescript'>Show</a> V3 script or [download](script.js){:target="_blank"} it.
3+
<div id='script_view' style="display:none">
4+
{% highlight javascript %}
5+
{% include_relative script.js %}
6+
{% endhighlight %}
7+
</div>
8+
9+
## Evaluate and visualize
10+
11+
- [Sentinel Playground](https://apps.sentinel-hub.com/sentinel-playground/?source=S2&lat=35.174032839292316&lng=35.90675354003906&zoom=12&preset=CUSTOM&layers=B01,B02,B03&maxcc=87&gain=1.0&gamma=1.0&time=2021-03-01%7C2021-09-10&atmFilter=&showDates=false&evalscript=Ly9WRVJTSU9OPTMKCi8qCgpTZW50aW5lbC0yIFdhdGVyIFN1cmZhY2UgVmlzdWFsaXplcgpBdXRob3I6IEhhcmVsIERhbiAoaHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2luL2hhcmVsLWRhbiwgaHR0cHM6Ly90d2l0dGVyLmNvbS9IYXJlbERhbikKClRoZSBzY3JpcHQgdXNlcyB0aGUgc21hbGwgc3BlY3RyYWwgY2hhbmdlcyBmb3VuZCBiZXR3ZWVuIGFkamFjZW50IGJhbmRzIHRvIGhpZ2hsaWdodCBhcmVhcyBvZiB2YXJpYW5jZQppbiBhbmQgb3RoZXJ3aXNlIGhvbW9nZW11b3VzIHJlZ2lvbi4gVGhpcyB0b29sIHdvcmtzIGJlc3Qgb24gZmxhdCB3YXRlciBzdXJmYWNlLCBhbmQgY2FuIGhpZ2hsaWdodCB3YXRlcgplZGRpZXMsIHRlbXBlcmF0dXJlIGluZHVjZWQgdm9ydGljZXMsIHN1c3BlbmRlZCBtYXR0ZXIgaW4gc2hhbGxvdyB3YXRlciwgb2lsIHNsaWNrcyBhbmQgc2hlZW5zLCBhbmQgbW9yZS4KCiovCgp2YXIgdjEgPSBNYXRoLmxvZygoQjAyL0IwMykpOyAKdmFyIHYyID0gTWF0aC5sb2coKEIwMy9CMDQpKTsKdmFyIHYzID0gTWF0aC5sb2coKEIwNC9CMDgpKTsKCnJldHVybiBbdjEsdjIsdjNdOwoKLy8gYWx0ZXJuYXRpdmVseSwgb25lIGNhbiBlbmhhY2UgdGhlIGdyZWVuIGJhbmQgZnJhY3Rpb24gc2xpZ2h0bHkgbW9yZSwgYnkgbXVsdGlwbHlpbmcgdjEgd2l0aCB2MiBpbiB0aGUgUiBiYW5kCi8vIHJldHVybiBbdjEqdjIsdjIsdjNdOw%3D%3D){:target="_blank"}
12+
13+
14+
## Author of the script
15+
[@HarelDan](https://twitter.com/HarelDan){:target="_blank"}
16+
17+
## General description of the script
18+
The script uses the small spectral changes found between adjacent bands to highlight areas of variance
19+
in and otherwise homogemuous region. This tool works best on flat water surface, and can highlight water
20+
eddies, temperature induced vortices, suspended matter in shallow water, oil slicks and sheens, and more.
21+
22+
## Description of representative images
23+
24+
Water surface artefacs near Baniyas refinery, Syria.
25+
There has been an ongoing man-made disaster with petroleum distilates spilling into the mediterraen and flowig as far as Cyprus/
26+
27+
28+
![Oils spill outside Baniyas refinery, Syria](figs/baniyas.jpg)
29+
30+
## References
31+
Based on:
32+
[source 1](https://twitter.com/HarelDan/status/1483415093014634499){:target="_blank"},
33+
34+
35+
36+
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//VERSION=3
2+
3+
/*
4+
5+
Sentinel-2 Water Surface Visualizer
6+
Author: Harel Dan (https://www.linkedin.com/in/harel-dan, https://twitter.com/HarelDan)
7+
8+
The script uses the small spectral changes found between adjacent bands to highlight areas of variance
9+
in and otherwise homogemuous region. This tool works best on flat water surface, and can highlight water
10+
eddies, temperature induced vortices, suspended matter in shallow water, oil slicks and sheens, and more.
11+
12+
*/
13+
14+
var v1 = Math.log((B02/B03));
15+
var v2 = Math.log((B03/B04));
16+
var v3 = Math.log((B04/B08));
17+
18+
return [v1,v2,v3];
19+
20+
// alternatively, one can enhace the green band fraction slightly more, by multiplying v1 with v2 in the R band
21+
// return [v1*v2,v2,v3];

0 commit comments

Comments
 (0)