nsb
Night-sky background evaluation and observation planning for ground-based astronomy.
This is the scientific runtime library for NSB. It provides typed point evaluation and observing-window search over the production-safe composition of zodiacal light, airglow, scattered moonlight, and an admitted integrated starlight product when one is available.
Installation
cargo add nsb@0.1.0
The minimum supported Rust version is 1.89.
NSB deliberately uses domain types from Siderust and tempoch at public boundaries instead of duplicating coordinate, atmosphere, or time semantics. Applications that construct those upstream types directly should add the corresponding dependencies as needed.
Cargo features
serde is enabled by default for backwards compatibility. It forwards
serialization support to siderust (including its coordinate and quantity
dependencies) and tempoch, covering the upstream Observer, Target,
and UTC Time types used at NSB's public Rust boundary.
To build without upstream Serde support:
nsb = { version = "0.1.0", default-features = false }
NSB's own internal TOML/JSON data formats remain available independently
of this feature; serde does not imply that all NSB evaluator, configuration,
or result structs implement Serde.
QTTY defines SurfaceBrightness (mag/arcsec²), which NSB re-exports through
nsb::units::photometry. This photometric newtype does not currently implement
Serde's traits upstream. Under nsb/serde, the
nsb::serde_support::surface_brightness field adapter lets applications
deserialize or serialize it as a plain JSON number without a separate wire
f64 field or a duplicate physical type:
use nsb::units::photometry::SurfaceBrightness;
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
struct NsbConstraintRequest {
#[serde(with = "nsb::serde_support::surface_brightness")]
minimum_nsb_in_mag_arcsec2: SurfaceBrightness,
#[serde(with = "nsb::serde_support::surface_brightness")]
maximum_nsb_in_mag_arcsec2: SurfaceBrightness,
}
The JSON remains {"minimum_nsb_in_mag_arcsec2":21.39,"maximum_nsb_in_mag_arcsec2":30.0}.
Application code must still validate finite, positive, ordered bounds before
converting magnitudes into profile-dependent photon radiance. This adapter
does not add validation to QTTY's type.
Minimal Rust workflow
use nsb::{ComponentMask, NsbEvaluator, PointQuery, Target, DEG};
use siderust::catalogs::observatories;
# fn evaluate(time: tempoch::Time<tempoch::UTC>) -> nsb::Result<()> {
let evaluator = NsbEvaluator::new()?;
let query = PointQuery::new(
observatories::EL_PARANAL.geodetic(),
time,
Target::new(266.41683 * DEG, -29.00781 * DEG),
)
.with_components(ComponentMask::ALL);
let result = evaluator.evaluate(&query)?;
println!("{}", result.integrated);
for component in &result.components {
println!("{}: {}", component.name, component.integrated);
}
# Ok(())
# }
Construct an evaluator once and reuse it. Immutable model data and runtime assets are prepared during evaluator construction.
Scientific interpretation
ComponentMask::DEFAULT and ComponentMask::ALL are the same
production-safe composition for the 0.1.x model contract. Starlight enters
that composition only when a validated production map is embedded. The
frozen candidate remains repository evidence; packages contain the approved
compact binary and sidecar, with all scientific f64 values preserved.
Observatory coordinates and scientific site assumptions are separate. The core crate exposes generic typed site profiles; CTAO North/South planning presets belong to application layers and are not site-calibration claims.
B/V magnitude and S10 outputs are central-wavelength diagnostics, not validated Johnson B/V passband integrations. Consult component maturity, provenance, validated-domain, uncertainty, and asset metadata before making scientific or operational claims.
Interfaces and documentation
- Rust API: https://docs.rs/nsb
- Repository documentation: https://github.com/VPRamon/NSB/tree/main/docs
- Scientific model: https://github.com/VPRamon/NSB/blob/main/docs/specifications/scientific-model.md
- Model maturity: https://github.com/VPRamon/NSB/blob/main/docs/specifications/model-maturity.md
- Validation matrix: https://github.com/VPRamon/NSB/blob/main/docs/specifications/validation.md
- Python distribution:
nsb-pyon PyPI, imported asnsb - CLI: sibling workspace crate
nsb-cli(binary namensb; not separately published in0.1.0)
The CLI owns command-line parsing, named-site lookup, and stable JSON/CSV
rendering. Offline catalogue acquisition and scientific data-product generation
belong to nsb-data-tools; the runtime library performs no catalogue downloads.
License
AGPL-3.0-only. Scientific assets and third-party dependencies retain their own licensing and attribution requirements; see the notices included in this crate and the repository asset manifests.
Scientific data and licensing
NSB code is AGPL-3.0-only; that does not make all scientific data AGPL. PALACE and selected reference products use CC BY 4.0, NOAA products have their applicable federal-work/data conditions, and Gaia-derived Starlight retains applicable CC BY-NC 3.0 IGO terms. The code may be used commercially under AGPL's obligations; commercial use of protected bundled data may need separate rights. Credits do not imply endorsement by ESA, DPAC, CDS or the authors.
The approved compact Starlight map is embedded for fully offline evaluation.
ALL, DEFAULT and the standard Rust/Python evaluator include Starlight,
Airglow, Moonlight and Zodiacal Light. The maintainer accepted the pinned
calculated-output and independent-data findings under #103; source-specific
licences and noncommercial data restrictions remain applicable.
See the source terms, attribution, public contact directory and concern procedure
and the distributed THIRD_PARTY_NOTICES.md. Cite the original scientific
sources, preserve their notices and assess the data terms for your actual use.
Metadata
Release files for nsb-py 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nsb_py-0.1.0.tar.gz | 6.4 MB | With provenance | Details for nsb_py-0.1.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| nsb_py-0.1.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for nsb_py-0.1.0-cp310-abi3-win_amd64.whl |
| nsb_py-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for nsb_py-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl |
| nsb_py-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for nsb_py-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl |
| nsb_py-0.1.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for nsb_py-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
| nsb_py-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for nsb_py-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 54.6 MB
Release files / nsb_py-0.1.0.tar.gz
| Download URL | nsb_py-0.1.0.tar.gz |
|---|---|
| Size | 6.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e23f788a8d572e698227818f66d5d144116548420a6127a465c6e8ab31e8cf8
|
|
BLAKE2b-256 checksum How to use checksums |
1b0cd420c17babcf05b0f489a30efd987349e8236e67d661e4b04bd656ee32c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / nsb_py-0.1.0-cp310-abi3-win_amd64.whl
| Download URL | nsb_py-0.1.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 9.5 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
71ed2d2ad8c694fcc835dc427785d962836a82dc20fde17c0a9337764bc9ae3c
|
|
BLAKE2b-256 checksum How to use checksums |
69167ede11c654bf511c83e73b2a0618a3295267784f3dbb768c29fa085876ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / nsb_py-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | nsb_py-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.7 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0cbb286f2f7d9ac60b86187ff11cb289be3dddcbc53ee1360ef1a8f505bf04bf
|
|
BLAKE2b-256 checksum How to use checksums |
5809b1a140874c594cff37eef4910f2ed0b6cf00a11e8e48702cb9a5f08a0d6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / nsb_py-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | nsb_py-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 9.7 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a597e040a7bf4ab232777e1ce726422b80f2153857162891b7de3e8c6104f096
|
|
BLAKE2b-256 checksum How to use checksums |
235ad44a0a840d671ee4d40b295927fc593ccd1ac07ce168243af1e3fb2692b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / nsb_py-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | nsb_py-0.1.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 9.7 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4f65aa1bb49e5679bc87c131058c78fb4e4bbfb90fe9d8b5f389ba828b0f7760
|
|
BLAKE2b-256 checksum How to use checksums |
1a8a5d4517bb57b1f54d0d365e43be47624d188f2907ddc6748f3d2ef5e2fb4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / nsb_py-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | nsb_py-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 9.6 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
eb3643283028cf3f6b6f8a37635e4af219f2c06bfa5d985b07095311e8d1b00e
|
|
BLAKE2b-256 checksum How to use checksums |
494449b35fc510370b24b5664e0832ce02b0b02b8372daf760bd58526a0f20e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logSecurity for nsb-py 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for nsb_py-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.