A Node.js CLI that, given a latitude/longitude, fetches one typical meteorological
year (TMY) of irradiance from the PVGIS TMY API,
builds a HEALPix (nside=4) sky radiance dome using the physics of the archived Python
notebooks in archive/, and writes a single JSON file in the shape of
test/data/irradiance_50.0_10.0_2018_yearly.json.
npm link # exposes the `skydome` command (or run: node bin/skydome)
skydome 50 10 -o irradiance_50.0_10.0_yearly.jsonOr without linking:
node bin/skydome 50 10 -o out.jsonskydome <lat> <lon> [--nside 4] [-o out.json]
--nsidesets the HEALPix resolution (default 4 → 192 pixels, 88 above horizon).-o/--outputsets the output path; default isirradiance_<lat>_<lon>_yearly.json.- Exits 1 with a clear message on network, parse, or validation errors.
For each daylight hour (solar zenith < 90°) and each HEALPix pixel:
- Diffuse: isotropic
L = DHI/πon every above-horizon pixel. - Direct:
DNI / pixel_solid_angleadded to the pixel containing the sun.
Annual averaging reproduces the reference quirks: per-pixel radiance is the mean over
daylight hours, then scaled by daylight/total (the "all-hours" average, i.e. the raw
sum divided by 8760). Metadata reports daylight-hour means.
Solar position uses a NOAA-compatible algorithm (accurate to ~0.1° vs pvlib's SPA), and the HEALPix grid is an exact port of the canonical RING operators (matching healpy).
npm testRuns node --test (offline, using the cached PVGIS fixture):
- geometry of the HEALPix grid matches
test/dataexactly (88 pixels, ring order) - solar position vs published values
- hand-computed skydome physics cases
- end-to-end pipeline from the cached fixture + radiance↔GHI physics self-check
- Monthly outputs (reference is yearly).