Back to the planner

Mathematical Foundations

Contract revision 1.0. Engine version 0.1.0. Dataset EXPLORATORY-era5-tcc-2020. This page explains; it does not compute, and the contract in docs/CONTRACT.md governs where they differ.

1. WGS84 and GEO geometry

Sites sit on the WGS84 ellipsoid with semi-major axis a=6378.137 kma=6378.137\,\mathrm{km} and flattening f=1/298.257223563f=1/298.257223563, at altitude zero. A site has geodetic latitude φ\varphi and longitude λ\lambda. Its first eccentricity squared is e2=f(2−f)e^2=f(2-f), and the prime-vertical radius of curvature ν\nu is

ν(φ)=a1−e2sin⁡2φ\nu(\varphi)=\frac{a}{\sqrt{1-e^{2}\sin^{2}\varphi}}
(1) Nu of phi equals a divided by the square root of one minus e squared times sine squared phi.

With height h=0h=0, the site in Earth-centred, Earth-fixed coordinates is

r⃗s=(νcos⁡φcos⁡λνcos⁡φsin⁡λν(1−e2)sin⁡φ)\vec{r}_{s}=\begin{pmatrix}\nu\cos\varphi\cos\lambda\\ \nu\cos\varphi\sin\lambda\\ \nu(1-e^{2})\sin\varphi\end{pmatrix}
(2) The site position has x equal to nu cosine phi cosine lambda, y equal to nu cosine phi sine lambda, and z equal to nu times one minus e squared times sine phi.

The satellite is geostationary at longitude LL on the equator, at radius R=42164 kmR=42164\,\mathrm{km}:

r⃗g=(Rcos⁡LRsin⁡L0)\vec{r}_{g}=\begin{pmatrix}R\cos L\\ R\sin L\\ 0\end{pmatrix}
(3) The satellite position is R cosine L, R sine L, zero.

Let d⃗=r⃗g−r⃗s=(dx,dy,dz)\vec{d}=\vec{r}_{g}-\vec{r}_{s}=(d_x,d_y,d_z). Its components in the site's local east, north and up directions are

dE=−sin⁡λ dx+cos⁡λ dydN=−sin⁡φcos⁡λ dx−sin⁡φsin⁡λ dy+cos⁡φ dzdU=cos⁡φcos⁡λ dx+cos⁡φsin⁡λ dy+sin⁡φ dz\begin{aligned}d_E&=-\sin\lambda\,d_x+\cos\lambda\,d_y\\ d_N&=-\sin\varphi\cos\lambda\,d_x-\sin\varphi\sin\lambda\,d_y+\cos\varphi\,d_z\\ d_U&=\cos\varphi\cos\lambda\,d_x+\cos\varphi\sin\lambda\,d_y+\sin\varphi\,d_z\end{aligned}
(4) D east is minus sine lambda d x plus cosine lambda d y. D north is minus sine phi cosine lambda d x, minus sine phi sine lambda d y, plus cosine phi d z. D up is cosine phi cosine lambda d x plus cosine phi sine lambda d y plus sine phi d z.

Here dEd_E, dNd_N, dUd_U are the east, north and up components of d⃗\vec{d}; the symbol ee is used only for the eccentricity. Elevation ε\varepsilon, slant range ρ\rho and azimuth α\alpha follow:

ε=atan2⁡ ⁣(dU,dE2+dN2),ρ=dE2+dN2+dU2,α=atan2⁡(dE,dN)\varepsilon=\operatorname{atan2}\!\left(d_U,\sqrt{d_E^{2}+d_N^{2}}\right),\qquad \rho=\sqrt{d_E^{2}+d_N^{2}+d_U^{2}},\qquad \alpha=\operatorname{atan2}(d_E,d_N)
(5) Elevation is the two-argument arctangent of d up and the square root of d east squared plus d north squared. Slant range is the square root of d east squared plus d north squared plus d up squared. Azimuth is the two-argument arctangent of d east and d north, taken in zero to 360 degrees.

Azimuth is reported in [0∘,360∘)[0^\circ,360^\circ), a computed 360 becoming 0. The arcsine form arcsin⁡(dU/ρ)\arcsin(d_U/\rho) is not used because it loses accuracy near the zenith.

Elevation is the angle of the satellite above the local horizontal plane at the site. sitesatelliteεlocal horizonEarth
Figure 1. Elevation ε\varepsilon is measured from the local horizontal plane; the slant range ρ\rho is the length of the line to the satellite.

A site is eligible when its elevation reaches the minimum. Elevation is first rounded to a microdegree, εμ=⌊106ε+12⌋\varepsilon_\mu=\lfloor 10^{6}\varepsilon+\tfrac12\rfloor, with ε\varepsilon in degrees, and the minimum εmin\varepsilon_{\mathrm{min}} is entered in tenths of a degree, mm:

eligible  ⟺  εμ≥105 m\text{eligible}\iff \varepsilon_{\mu}\ge 10^{5}\,m
(6) A site is eligible exactly when epsilon sub mu is at least m times one hundred thousand. Equality is eligible.

Equality is eligible. The rounding is used for this decision only; reported elevation, slant range and azimuth are not rounded. Azimuth is not defined when εμ≥9×107\varepsilon_\mu\ge 9\times10^{7}.

2. Historical screening and threshold semantics

For site ii and hour tt, ERA5 supplies total cloud cover ci,t∈[0,1]c_{i,t}\in[0,1] for the 0.25 degree cell holding the site. For a threshold τ∈{0.05,0.10,0.20}\tau\in\{0.05,0.10,0.20\} the hour is clear when

Ui,t={1ci,t≤τ0otherwiseU_{i,t}=\begin{cases}1&c_{i,t}\le\tau\\ 0&\text{otherwise}\end{cases}
(7) U of i and t equals one when c of i and t is at most tau, and zero otherwise.

The comparison is exact and inclusive. The stored values are 32-bit floating point numbers widened exactly to 64 bits and compared with τ\tau read as the nearest 64-bit number. As a result the 32-bit values nearest 0.05, 0.10 and 0.20 widen to just above τ\tau and count as cloudy, while the 64-bit 0.10 itself is clear. Classification happens once, when the data are packaged; the browser never compares cloud values.

This is a screen of past weather in a reanalysis cell. It is not a measurement at the site and not a model of an optical link.

3. Individual screening fractions

For a window WW of hourly samples, the individual screening fraction of site ii is its share of clear hours. It uses weather only and ignores elevation, so excluded sites still have one:

pi=1∣W∣∑t∈WUi,tp_{i}=\frac{1}{|W|}\sum_{t\in W}U_{i,t}
(8) p of i equals the sum over hours t in the window of U of i and t, divided by the number of hours in the window.

The interface shows the count and the denominator beside every fraction. A fraction whose denominator is zero, for example a season absent from the window, is shown as N/A.

4. Geographic diversity and synchronised weather correlation

For a set SS of sites, a network hour is clear when at least one site is clear in the same hour:

C(S)=∑t∈W⋁i∈SUi,t,A(S)=C(S)∣W∣C(S)=\sum_{t\in W}\bigvee_{i\in S}U_{i,t},\qquad A(S)=\frac{C(S)}{|W|}
(9) C of S equals the sum over hours t in W of the logical OR over sites i in S of U of i and t. A of S is C of S divided by the number of hours.

Using the same hours for every site is what carries the real weather correlation into the result. Nearby sites tend to be cloudy together, so adding one adds little; distant sites tend to differ, so adding one adds more. The tempting shortcut of multiplying separate outage probabilities,

1−∏i∈S(1−pi)1-\prod_{i\in S}\left(1-p_{i}\right)
(10) One minus the product over i in S of one minus p of i, which is not what the planner computes.

assumes independence and is not used. For a selected pair a<ba<b, the conditional share of hours with aa clear when bb is out is computed from counts, where NabN_{ab} counts hours when both are out and NbN_b hours when bb is out:

P(a clear∣b out)=1−NabNbP(a\text{ clear}\mid b\text{ out})=1-\frac{N_{ab}}{N_{b}}
(11) The probability that a is clear given b is out equals one minus N sub a b divided by N sub b, and is not available when N sub b is zero.

It is N/A when Nb=0N_b=0. These pair figures are descriptive. The marginal contribution of a selected site is the hours the network would lose without it:

δi=C(S)−C(S∖{i})\delta_{i}=C(S)-C\left(S\setminus\{i\}\right)
(12) Delta of i equals C of S minus C of S without i.

Marginal contributions need not add up to C(S)C(S), since an hour covered by two sites counts for neither.

Two sites with complementary clear hours together cover every hour. site asite bunion hours in time order: shaded = clear, white = cloudy
Figure 2. Sites a and b are never clear in the same hour here, so their union is clear in every hour although each alone is clear half the time.

5. Exact cardinality-constrained maximum coverage

Let FF be the feasible (eligible) sites. For each k=1,…,min⁡(6,∣F∣)k=1,\dots,\min(6,|F|) the planner finds a best set of exactly kk sites on the training window:

Sk⋆∈arg max⁡S⊆F,  ∣S∣=k  Ctrain(S)S_{k}^{\star}\in\operatorname*{arg\,max}_{S\subseteq F,\;|S|=k}\;C_{\mathrm{train}}(S)
(13) S star sub k is a set with k sites chosen from F that maximises C on the training window. Ties go to the smallest sorted array of site IDs.

The result is exact, by depth-first search over all subsets, not a greedy approximation. Counts are integers and are compared as integers. Ties are broken by the smallest array of site IDs, compared element by element. In target mode the answer is the smallest kk whose best set reaches the target qq, given in parts per million, with all arithmetic in integers:

k⋆=min⁡{k:  106 Ctrain(Sk⋆)≥q ∣Wtrain∣}k^{\star}=\min\left\{k:\;10^{6}\,C_{\mathrm{train}}(S_{k}^{\star})\ge q\,|W_{\mathrm{train}}|\right\}
(14) k star is the smallest k such that one million times C of S star k is at least q times the number of training hours.

The baseline is the same number of feasible sites with the largest individual training counts, ties by ID. The comparison with the optimum shows what choosing sites one by one leaves unused. If no kk reaches the target, the interface says so and shows the best found, not a selection.

6. Selection and replay windows within 2020

This exploratory demonstration holds one calendar year. Hours are numbered from 0, hour tt being the start time plus tt hours in UTC. The year is split chronologically into two half open, adjacent windows:

Wtrain=[0, 6576),Wholdout=[6576, 8784)W_{\mathrm{train}}=[0,\,6576),\qquad W_{\mathrm{holdout}}=[6576,\,8784)
(15) The selection window is hours 0 up to but not including 6576. The replay window is hours 6576 up to but not including 8784.

All selection uses the first window, Jan to Sep 2020. The replay scores the same site IDs on the second, Oct to Dec 2020:

Choldout ⁣(Sk⋆)C_{\mathrm{holdout}}\!\left(S_{k}^{\star}\right)
(16) The replay count is C on the replay window of the fixed set S star k, found with the selection window only.
The selection window comes first, then the replay window; selection looks only at the first. selection: Jan to Sep 2020hour 0hour 6576
Figure 3. Sites are chosen on the shaded part and only then scored on the rest, Oct to Dec 2020, up to hour 8784.

The two windows are different seasons of the same year, so a difference between them mixes season with chance and says little about how a selection would generalise. The replay is exploratory and is not a validation. There is no predeclared protocol and no validation record for this demonstration. One year is not a climatology.

7. Assumptions, limitations and references

References

8. Traceability

Each equation maps to the part of the contract or protocol it restates. The numerical column says what is checked by the test suite against fixtures, where the equation can be evaluated.

EquationSourceChecked against
(1), (2)Contract, Geometry (WGS84)Geometry fixtures, within the stated tolerances
(3), (4), (5)Contract, GeometryGeometry fixtures: elevation 1e-6 degrees, slant 1 m, circular azimuth 1e-6 degrees
(6)Contract, Eligibility rule EB-1Boundary fixtures, exact
(7)Contract, ThresholdsThreshold fixtures, exact
(8), (9)Contract, ResultsWorked example counts
(10)Scope, scientific model (not used)Worked example: shows why it differs
(11), (12)Contract, Results (pairs, marginal)Fixture results
(13), (14)Contract, Results (optimalByK, target)Worked example optima, ties
(15), (16)Contract, Time and order; Validation versus explorationWorked example replay

Data and attribution. Contains modified Copernicus Climate Change Service information 2020. Neither the European Commission nor ECMWF is responsible for any use of this information.

ERA5 hourly data on single levels, Copernicus Climate Change Service, doi:10.24381/cds.adbb2d47, licensed CC BY 4.0. Distributed by NSF NCAR GDEX: European Centre for Medium-Range Weather Forecasts (2019), ERA5 Reanalysis (0.25 Degree Latitude-Longitude Grid), doi:10.5065/BH6N-5N20.

Modified: total cloud cover extracted at the nearest 0.25 degree grid point of 24 illustrative sites, stored as 32-bit floats and classified clear or cloudy at three thresholds. Nothing here is optical-link availability, a site qualification or a forecast.