Compare commits
No commits in common. "cdfa350dc667b5d66dd7a4cde81700bfb71b6164" and "e58719f18ba9d2d2b555085f414027dd2e78e714" have entirely different histories.
cdfa350dc6
...
e58719f18b
2 changed files with 4 additions and 19 deletions
13
4-fusion.py
13
4-fusion.py
|
|
@ -117,11 +117,7 @@ def compute_gcc_from_refl(refl_dir: Path, gcc_dir: Path) -> None:
|
||||||
"""Derive GCC from ``REFL_YYYYMMDD.tif`` files (BtI fusion output).
|
"""Derive GCC from ``REFL_YYYYMMDD.tif`` files (BtI fusion output).
|
||||||
|
|
||||||
Reads every ``REFL_*.tif`` and writes a co-located single-band
|
Reads every ``REFL_*.tif`` and writes a co-located single-band
|
||||||
``GCC_YYYYMMDD.tif``. Pixels where any reflectance band is negative (which
|
``GCC_YYYYMMDD.tif``. Zero pixels remain zero.
|
||||||
can arise from EFAST's temporal correction) are written as NaN; the GCC
|
|
||||||
ratio is undefined there because the denominator B+G+R is near-zero or
|
|
||||||
negative due to band cancellation. All-zero pixels (cloud mask) remain
|
|
||||||
zero.
|
|
||||||
"""
|
"""
|
||||||
gcc_dir.mkdir(parents=True, exist_ok=True)
|
gcc_dir.mkdir(parents=True, exist_ok=True)
|
||||||
for src_path in sorted(refl_dir.glob("REFL_*.tif")):
|
for src_path in sorted(refl_dir.glob("REFL_*.tif")):
|
||||||
|
|
@ -132,10 +128,9 @@ def compute_gcc_from_refl(refl_dir: Path, gcc_dir: Path) -> None:
|
||||||
b, g, r = src.read(1), src.read(2), src.read(3)
|
b, g, r = src.read(1), src.read(2), src.read(3)
|
||||||
profile = src.profile
|
profile = src.profile
|
||||||
total = b + g + r
|
total = b + g + r
|
||||||
invalid = (b < 0) | (g < 0) | (r < 0)
|
gcc = g / (total + 1e-10)
|
||||||
gcc = np.where(invalid, np.nan, g / (total + 1e-10))
|
gcc[total == 0] = 0
|
||||||
gcc[total == 0] = np.nan
|
profile.update(count=1)
|
||||||
profile.update(count=1, dtype="float32")
|
|
||||||
with rasterio.open(out_path, "w", **profile) as dst:
|
with rasterio.open(out_path, "w", **profile) as dst:
|
||||||
dst.write(gcc[np.newaxis].astype("float32"))
|
dst.write(gcc[np.newaxis].astype("float32"))
|
||||||
|
|
||||||
|
|
|
||||||
10
index.html
10
index.html
|
|
@ -123,15 +123,6 @@ body { margin: 0; font: 13px/1.4 system-ui, sans-serif; background: #f5f5f5; col
|
||||||
}
|
}
|
||||||
#worldMapBtn:hover { background: #3a5278; }
|
#worldMapBtn:hover { background: #3a5278; }
|
||||||
|
|
||||||
#repoLink {
|
|
||||||
margin-left: auto;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #7eb8f7;
|
|
||||||
text-decoration: none;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
#repoLink:hover { color: #9ecef8; text-decoration: underline; }
|
|
||||||
|
|
||||||
/* worldwide map overlay */
|
/* worldwide map overlay */
|
||||||
#worldOverlay {
|
#worldOverlay {
|
||||||
display: none; position: fixed; inset: 0; z-index: 3000;
|
display: none; position: fixed; inset: 0; z-index: 3000;
|
||||||
|
|
@ -167,7 +158,6 @@ body { margin: 0; font: 13px/1.4 system-ui, sans-serif; background: #f5f5f5; col
|
||||||
<label>Year <select id="yearSel"></select></label>
|
<label>Year <select id="yearSel"></select></label>
|
||||||
<span id="sitesCount" style="font-size:12px;color:#aaa;white-space:nowrap"></span>
|
<span id="sitesCount" style="font-size:12px;color:#aaa;white-space:nowrap"></span>
|
||||||
<button type="button" id="worldMapBtn" title="World map of all sites">World map</button>
|
<button type="button" id="worldMapBtn" title="World map of all sites">World map</button>
|
||||||
<a id="repoLink" href="https://git.delattre.de/pantierra/efast-phenocam-validation" target="_blank" rel="noopener noreferrer">Source code</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="worldOverlay" aria-hidden="true">
|
<div id="worldOverlay" aria-hidden="true">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue