# Validation & Equation Reference This tool is a browser re-implementation of the **PNNL / U.S. DOE Sky Glow Comparison Tool** (PNNL-SA-138348), based on the Kocifaj radiative-transfer model. Its equations and outputs were verified, line by line, against the authoritative sources below. **Reference sources** 1. **PNNL spreadsheet** — `Sky Glow Comparison Tool for Public Release V1.xlsm` (worksheet formulas, the embedded scattering-function tables, and the VBA modules `Calculate.bas`, `AddSPD.bas`, and `CCT_FromUV_Function.bas`). 2. **Independent field check** — a manual run of *DOE Sky Glow Calculator v1* recorded by the user in 2022 (scotopic weighting, clear/low-particulate, FAR and NEAR observers). All scattering-function tables (48 of them), the 12 example SPDs, the CIE 1931 2° colour- matching functions, the scotopic V′(λ) curve, and the photopic V(λ) curve embedded in this app are taken directly from that spreadsheet. --- ## 1. Equation comparison ### 1a. Sky-glow model — *equation-for-equation identical* | Step | PNNL spreadsheet (`Calculate.bas` / `AddSPD.bas`) | This app (`index.html`) | Status | |---|---|---|---| | Chromaticity *x, y* | `SUMPRODUCT(SPD, CIE-1931 CMF) / (X+Y+Z)` | `Σ spd·cmf / (X+Y+Z)`, same CMFs | ✅ identical | | SPD normalization | Each SPD pre-scaled to **1000 lm**: `Φ = Σ 683·SPD·V(λ)·Δλ`, `SPD′ = SPD·1000/Φ` | Applied inline: **`÷ Σ SPD·V(λ)`** | ✅ equivalent — the constants (683, Δλ, 1000) cancel in the baseline ratio | | Sky glow per source | `Σ (SPD′ · SF)` | `Σ (SPD · SF)` | ✅ identical | | Scattering-function selection | match `atm` + `obs` + `uplight` + `weighting` across 48 tables | `getSF()` — same match over the same 48 tables | ✅ identical | | Spectral integration | Trapezoidal rule, `5·(f[n+1]+f[n])/2` summed over 380–770 nm | Rectangular sum `Σ f[n]` | ✅ equivalent for the ratio (endpoints ≈ 0; the ×5 cancels) | | Lumen output % | `SPDtest × (lmout/100)` | `× lumenPct` | ✅ identical | | **Relative sky glow** | `SGtest / SGbase` | `sg(test) / sg(base)` | ✅ identical | The only implementation differences (trapezoidal vs. rectangular integration; lumen normalization applied at input vs. inline) are mathematically equivalent for the reported relative-sky-glow ratio and account for the ≈0.3 % residual seen in §2b. ### 1b. Correlated colour temperature (CCT) — *exact port* | Aspect | PNNL spreadsheet | This app | Status | |---|---|---|---| | Colour-matching functions | CIE 1931 2°, *x,y* → CIE 1960 UCS *u,v* | same | ✅ identical | | *u, v* transform | `u = 4x/(−2x+12y+3)`, `v = 6y/(−2x+12y+3)` | same | ✅ identical | | CCT algorithm | Robertson (1968) / Mori isotemperature-line interpolation — `CCT(u,v)` VBA + `BBR-Isotemp` table | Faithful port of the same algorithm + the same 32-row isotemperature table | ✅ identical | > **Note:** the original artifact used McCamy's 1992 cubic approximation, which agreed with > the spreadsheet to within ~1 %. It has been replaced with a direct port of the > spreadsheet's Robertson method (including the "below 1667 K → not reported" guard) so CCT > now matches the spreadsheet exactly. --- ## 2. Validation results ### 2a. CCT — every source matches the spreadsheet exactly | Source | This app (Robertson) | PNNL spreadsheet | |---|---|---| | HPS Example | 2040 K | 2040 K | | LPS Example* | 1718 K | 1718 K | | Metal Halide Example | 3925 K | 3925 K | | PC Amber LED Example | 1873 K | 1873 K | | LED Example 1 | 2703 K | 2703 K | | LED Example 2 | 2978 K | 2978 K | | LED Example 3 | 3940 K | 3940 K | | LED Example 4 | 4098 K | 4098 K | | LED Example 5 | 5196 K | 5196 K | | LED Example 6 | 6103 K | 6103 K | | MH 2 (4041 K) | 4041 K | 4041 K | | MV H38JA-100/DX | 3430 K | 3430 K | \* Low-pressure sodium is effectively monochromatic; its CCT is mathematically ill-defined and shown only for completeness. ### 2b. Relative sky glow vs. the spreadsheet Scenario: **near** observer, **clear/low-particulate** atmosphere, **unweighted**, baseline and comparison **uplight 0 %**, **100 % lumen output**, baseline = HPS — matching the spreadsheet's saved state. | Comparison source | This app | PNNL spreadsheet | Δ | |---|---|---|---| | MH 2 (4041 K) | 1.789 | 1.794 | 0.3 % | | MV H38JA-100/DX | 1.733 | 1.739 | 0.3 % | | LED 2719 K | 1.292 | 1.295 | 0.3 % | | LED V Pump 2724 K | 1.571 | 1.576 | 0.3 % | | LED 285 (4075 K) | 1.407 | 1.411 | 0.3 % | | LED 231 (4224 K) | 1.462 | 1.467 | 0.3 % | | LED Example 5 | 1.490 | 1.495 | 0.4 % | Residual ≤ 0.4 % is the trapezoidal-vs-rectangular integration difference plus the 5 nm vs. 1 nm V(λ) grid. ### 2c. Independent field check — DOE Sky Glow Calculator v1 (2022 manual run) Scotopic weighting, clear/low particulate. All values relative to **HPS @ 2 % uplight, 100 % output = 1.00**. Format: *manual run / **this app***. **FAR observer** | Source | 2 % · 100 % | 2 % · 50 % | 0 % · 100 % | 0 % · 50 % | |---|---|---|---|---| | HPS | 1.00 / **1.00** | 0.50 / **0.50** | 0.05 / **0.05** | 0.02 / **0.02** | | 4075 K | 2.45 / **2.45** | 1.23 / **1.22** | 0.11 / **0.11** | 0.06 / **0.06** | | 2719 K | 1.96 / **1.95** | 0.98 / **0.98** | 0.09 / **0.09** | 0.05 / **0.05** | **NEAR observer** | Source | 2 % · 100 % | 2 % · 50 % | 0 % · 100 % | 0 % · 50 % | |---|---|---|---|---| | HPS | 1.00 / **1.00** | 0.50 / **0.50** | 0.80 / **0.80** | 0.40 / **0.40** | | 4075 K | 2.53 / **2.53** | 1.27 / **1.27** | 2.04 / **2.04** | 1.02 / **1.02** | | 2719 K | 1.99 / **1.99** | 0.99 / **0.99** | 1.60 / **1.60** | 0.80 / **0.80** | 14 of 16 cells match exactly; the two others differ by 0.01 in the last digit (rounding). This independently confirms the model's signature behaviour — strong uplight sensitivity for a distant observer (HPS 1.00 → 0.05 from 2 % to 0 % uplight) versus weak sensitivity nearby (1.00 → 0.80) — and that lumen output scales the result linearly. --- ## Notes on the Sky Glow Index column The "Sky Glow Index" shown in the comparison table is the modeled sky glow **per lumen**: `Σ(SPD·SF) ÷ Σ(SPD·V(λ)) × lumen%`. It is in arbitrary model units (the native scale of the scattering-function tables, ~10⁻⁷) and is meaningful **only relative to the baseline** — it is not cd/m² or mag/arcsec². The "vs Baseline" column is the interpretable result. _Last validated: 2026-06 against `Sky Glow Comparison Tool for Public Release V1.xlsm`._ --- ## 3. Cross-check vs the strategy white paper, Table 4-1 (added 2026-07-25) Table 4-1 of the DarkSky "Holistic Strategy to Reduce Light Pollution" draft (built years earlier with the DOE/Excel Sky Glow Calculator v1) was recomputed with this app: baseline HPS 2% uplight / 100% output, scotopic weighting, clear low-particulate, both observers, 12 cells per observer. **Result: 16 of 24 cells reproduce exactly at the paper's displayed precision.** | row | verdict | |---|---| | HPS (both observers, all 8 cells) | identical (1.00/0.50/0.05/0.02 FAR; 1.00/0.50/0.80/0.40 NEAR) | | "2719 K" LED (8 cells) | identical to our `LED - Example 1 (2703 K)` within ±0.01 — same SPD, different CCT algorithm label | | "4075 K" LED (8 cells) | NOT one of the 12 embedded example SPDs. Paper: FAR 2.45, NEAR 2.53. Ours: Example 3 (3940 K) 2.24/2.28, Example 4 (4098 K) 2.86/2.98. The offset is a constant ratio across all 8 cells → identical scattering model, different input spectrum. The paper's SPD is evidently the specific street-light LED from the PNNL 2017 report / DOE calculator v1, intermediate in blue content between our Examples 3 and 4. | Follow-up: obtain the 4075 K SPD from the DOE v1 workbook and add it to the library (the app accepts pasted SPDs); it should then reproduce the remaining 8 cells exactly. **Resolution (2026-07-25, same day):** the paper's exact spectra were located in the PNNL workbook's *Saved SPDs* sheet — `LED 2719 K` (col M) and `LED 285 4075K` (col AX) — and added to the shared spectral library (v1.2.0). With them, all **24/24 cells of Table 4-1 reproduce** at the paper's displayed precision (two cells sit on an exact .xx5 and round oppositely: 1.23→1.22, 1.96→1.95). The white paper's table is now reproducible in this app by selecting those two sources.