Expand description
nsb — Night Sky Background model.
Computes the photon flux reaching a ground-based observer from a configurable sum of zodiacal light, integrated starlight, airglow, and scattered moonlight. Integrated starlight is included in defaults only when the build embeds a validated production catalogue-derived map.
The library API is intentionally typed and CLI-free: callers pass
Observer values, Time<UTC> instants, and equatorial Target
directions directly. Named-site parsing, command-line flags, and output
formatting belong in a separate CLI crate that consumes this library.
§Supported public API
The first-release surface is classified in
docs/developer-guide/public-api.md.
- Core root API — normal evaluator/planning integrations and durable component selectors.
- Advanced nested API —
components::starlight,components::airglow,site, andsolar_activityfor supported scientific workflows. - Metadata/schema API — intentional persisted or inspectable records (bundled assets, F10.7 stores).
- Private implementation — concrete component evaluators, spectra, planning internals, and test/tooling helpers.
The recommended application path is:
- Build an
NsbEvaluatorfromNsbModelConfig. - Evaluate a
PointQueryor search withThresholdQuery. - Read
NsbResult/ThresholdQueryResultand per-componentNsbComponentMetadata.
§Airglow selection
NsbModelConfig::generic_clear_sky, NsbModelConfig::default, and
NsbEvaluator::new use AirglowSelection::Automatic. Explicit
NsbModelConfig::with_airglow_model selection wins and never silently
switches models. Until the global climatological model is admitted (#157),
automatic policy resolves to the temporary Paranal-derived planning fallback
with typed fallback metadata in NsbComponentMetadata::airglow_selection.
Physical evaluation outcomes live in
NsbComponentMetadata::airglow_evaluation and are absent from
NsbEvaluator::describe_components descriptors.
§Dependency types
NSB uses Siderust, qtty, and tempoch types at the supported boundary
(Observer, Target, Time<UTC>, radiances, angles). The units
module is the canonical NSB-facing entry point for qtty: it re-exports
the upstream crate and the quantity modules used by NSB. DEG remains
re-exported at the crate root for the documented getting-started path.
§Architecture
Shared physical spectra used across components live in the internal spectra
module; component-specific calibrations and grids live inside their component
modules.
siderust owns astronomy, time, coordinates, events, atmosphere, lunar
photometry, and passbands. NSB owns NSB-specific component composition,
atmospheric-transport orchestration (transport), observing-window
planning, and site-profile metadata that distinguishes generic fallbacks
from explicit named planning presets.
Re-exports§
pub use components::airglow::AirglowModel;pub use components::airglow::AirglowSelection;pub use components::moonlight::MoonlightModel;pub use components::starlight::StarlightProduct;pub use components::zodiacal::ZodiacalExtinction;pub use components::zodiacal::ZodiacalModel;pub use site::CalibrationStatus;pub use site::GenericClearSky;pub use site::SiteProfile;pub use site::SiteProfileTag;pub use units::SolarFluxUnit;pub use units::SolarFluxUnits;
Modules§
- components
- Advanced component models used to construct or inspect individual contributors. Physical and empirical NSB component models.
- data
- Runtime scientific data and build-verified bundled metadata. Runtime ownership for NSB scientific data.
- serde_
support - Serde field adapters for QTTY photometric types used by NSB consumers. Serde adapters for externally defined photometric types.
- site
- Site profiles and shared atmospheric assumptions. Scientific site profiles, shared atmospheric assumptions, and calibration metadata.
- solar_
activity - Offline F10.7 resolution used by airglow configuration. Date-aware F10.7 solar-radio-flux resolution.
- transport
- Atmospheric transport of spectral sky radiance (identity and direct paths). Atmospheric transport of spectral radiance.
- units
- Physical quantities, NSB-specific conventions, and the
qttyfacade. NSB quantity facade and domain-specific unit conventions.
Structs§
- Band
Diagnostic - Meaning and zero point of reported B/V diagnostics.
- Component
Mask - Components that can be composed by
NsbEvaluator. - NsbComponent
- One reported component contribution.
- NsbComponent
Descriptor - Metadata-only description of a selected component.
- NsbComponent
Metadata - Scientific interpretation attached to a component result.
- NsbEvaluator
- Reusable evaluator with parsed immutable component data.
- NsbModel
Config - Immutable model choices used to construct an evaluator.
- NsbResult
- Complete result of one point evaluation.
- Point
Query - Inputs for one point evaluation.
- Site
Window Context - Reusable target-independent preparation for searches at one site and time window.
- Threshold
Query - Inputs for a below-threshold observing-window search.
- Threshold
Query Result - Result of a below-threshold window search.
Enums§
- Component
Calibration Status - Scientific calibration/maturity classification.
- NsbError
- Failures returned by NSB model construction and evaluation.
Constants§
- DEG
- Angle unit used with
Target::newin documented examples. One degree. - MODEL_
VERSION - Versioned model-composition contract used in operational metadata.
- NSB_
VERSION - Version of the NSB library crate.
- SIDERUST_
SOURCE - Truthful package-source identity for the Siderust dependency.
- SIDERUST_
VERSION - Siderust package version represented by the locked dependency.