API Reference / skyBrightness · function

Function: skyBrightness()

function skyBrightness(
   altDeg, 
   azDeg, 
   ctx): number;

Approximate V-band sky surface brightness (mag/arcsec^2) of the sky at a direction: a render cue for the sky gradient, not precision photometry. Composes, in linear flux space, (a) the site's moonless zenith sky by Bortle class (BORTLE_ZENITH_MAG), brightened toward the horizon by the airglow term (AIRGLOW_HORIZON_MAG, scaled by the Kasten & Young airmass excess); (b) twilight from the Sun's altitude (TWILIGHT_RAMP, treated as direction-independent -- the azimuthal afterglow gradient stays a prose cue via brightestAzimuth); and (c) a Krisciunas & Schaefer-inspired moonlight term (PASP 103, 1033, 1991): scattered moonlight falling off ~0.04 mag per degree of angular distance from the Moon (their 10^(-rho/40) scattering wing, softened toward the measured large-angle brightening), scaling linearly with illuminated fraction and dimmed by the extra airmass along the Moon's own path. The anchors reproduce the model's full-Moon predictions at a dark site: sky ~17.5 near the Moon, ~1.5 mag of brightening 90 deg away. Typical checks: Bortle 1 night zenith 21.9, its horizon 21.5, clear daytime ~4.0.

Parameters

ParameterType
altDegnumber
azDegnumber
ctxSkyBrightnessCtx

Returns

number

Start building

Quickstart →