Skip to content

Commit f689990

Browse files
Made default tab opening more responsive
1 parent 8fa94e3 commit f689990

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

_config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@ gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into t
2727

2828
plugins:
2929
- jekyll-seo-tag
30+
31+
callouts:
32+
note:
33+
title: Note
34+
color: yellow

_includes/js/custom.js

-3
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,5 @@
5454
}
5555
});
5656
});
57-
// Get the element with id="defaultOpen" and click on it
58-
document.getElementById("defaultOpen").click();
59-
6057
});
6158
})(window.jtd = window.jtd || {});

_layouts/script.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ <h1 class="d-inline" id={{page.slug}}> {{page.title}} </h1>
99
<div class="tab", id="script">
1010

1111
{% for script in page.scripts %}
12-
<button class="tablinks" onclick="openTab(event, '{{ script[0] }}')" {%- if forloop.first -%} id="defaultOpen" {%- endif -%}>{{ script[0] }}</button>
12+
<button class="tablinks {% if forloop.first %} active {%- endif -%}" onclick="openTab(event, '{{ script[0] }}')">{{ script[0] }}</button>
1313
{% else %}
1414
<!-- This will be carried out by default if page.scripts is empty -->
15-
<button class="tablinks" onclick="openTab(event, 'Evalscript')" id="defaultOpen">Evalscript</button>
15+
<button class="tablinks active" onclick="openTab(event, 'Evalscript')">Evalscript</button>
1616
{% endfor %}
1717
</div>
1818

@@ -21,13 +21,13 @@ <h1 class="d-inline" id={{page.slug}}> {{page.title}} </h1>
2121
{% for script in page.scripts %}
2222
{% assign file = script[1] %}
2323
<!-- Tab content -->
24-
<div id="{{ script[0] }}" class="tabcontent">
24+
<div id="{{ script[0] }}" class="tabcontent" {% if forloop.first %} style="display: block;" {%- endif -%}>
2525
{% highlight javascript %}
2626
{% include_relative {{ file }} %}
2727
{% endhighlight %}
2828
</div>
2929
{% else %}
30-
<div id="Evalscript" class="tabcontent">
30+
<div id="Evalscript" class="tabcontent" style="display: block;">
3131
{% highlight javascript %}
3232
{% include_relative script.js %}
3333
{% endhighlight %}

sentinel-2/ndmi/README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ permalink: /sentinel-2/ndmi/
77
nav_exclude: true
88
---
99

10+
# TODO: Replace links with new (short) ones, add CDSE, make new figures?
11+
1012

1113
## Evaluate and visualize
1214

@@ -15,14 +17,13 @@ nav_exclude: true
1517

1618
## General description of the script
1719

18-
1920
The NDMI is a normalized difference moisture index, that uses NIR and SWIR bands to display moisture.
2021
The SWIR band reflects changes in both the vegetation water content and the spongy mesophyll structure in vegetation canopies,
2122
while the NIR reflectance is affected by leaf internal structure and leaf dry matter content but not by water content.
2223
The combination of the NIR with the SWIR removes variations induced by leaf internal structure and leaf dry matter content, improving the accuracy in retrieving the vegetation water content.
2324
The amount of water available in the internal leaf structure largely controls the spectral reflectance in the SWIR interval of the electromagnetic spectrum.
2425
SWIR reflectance is therefore negatively related to leaf water content. In short, NDMI is used to monitor changes in water content of leaves, and was [proposed by Gao.](https://www.sciencedirect.com/science/article/abs/pii/S0034425796000673){:target="_blank"}
25-
NDWI is computed using the near infrared (NIR) and the short wave infrared (SWIR) reflectance’s:
26+
NDMI is computed using the near infrared (NIR) and the short wave infrared (SWIR) reflectances:
2627

2728
Sentinel-2 NDMI = **(B08 - B11) / (B08 + B11)**
2829

@@ -34,7 +35,9 @@ Sentinel-2 NDMI = **(B08 - B11) / (B08 + B11)**
3435

3536
[MODIS NDMI](https://custom-scripts.sentinel-hub.com/modis/ndmi/) = **(B02 - B06) / (B02 + B06)**
3637

37-
_Note: NDWI index is often used synonymously with the NDMI index, often using NIR-SWIR combination as one of the two options. Gao, referenced above, also called the index NDWI. NDMI seems to be consistently described using NIR-SWIR combination. As the indices with these two combinations work very differently, with NIR-SWIR highlighting differences in water content of leaves, and GREEN-NIR highlighting differences in water content of water bodies, we have decided to separate the indices on our repository as NDMI using NIR-SWIR, and NDWI using GREEN-NIR._
38+
{: .note}
39+
40+
NDWI index is often used synonymously with the NDMI index, often using NIR-SWIR combination as one of the two options. Gao, referenced above, also called the index NDWI. NDMI seems to be consistently described using NIR-SWIR combination. As the indices with these two combinations work very differently, with NIR-SWIR highlighting differences in water content of leaves, and GREEN-NIR highlighting differences in water content of water bodies, we have decided to separate the indices on our repository as NDMI using NIR-SWIR, and NDWI using GREEN-NIR.
3841

3942
## Description of representative images
4043

0 commit comments

Comments
 (0)