Skip to main content

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.1

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.1", 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

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nsb-py 0.1.1
File Size Uploaded Provenance Actions
nsb_py-0.1.1.tar.gz 6.4 MB With provenance Details for nsb_py-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for nsb-py 0.1.1
File Actions
nsb_py-0.1.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for nsb_py-0.1.1-cp310-abi3-win_amd64.whl
nsb_py-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for nsb_py-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl
nsb_py-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for nsb_py-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl
nsb_py-0.1.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for nsb_py-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
nsb_py-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for nsb_py-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 54.6 MB

Release files / nsb_py-0.1.1.tar.gz

Download URL nsb_py-0.1.1.tar.gz
Size 6.4 MB
Tags Source
SHA-256 checksum
How to use checksums
395fc2d634df5de736d060dc9100fc648fc09e2caccfcfec763ca16f5b22bb1e
BLAKE2b-256 checksum
How to use checksums
fdacbcb6916295bd4546836599ea0406ed1a4a78ccaee9fc62a877a1d6c661ae
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 16, 2026.

Transparency log

Release files / nsb_py-0.1.1-cp310-abi3-win_amd64.whl

Download URL nsb_py-0.1.1-cp310-abi3-win_amd64.whl
Size 9.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
45b3bf1643efc4fb3fb161e19c1cefff5ea823a3bbbab69516ee267d99db52ce
BLAKE2b-256 checksum
How to use checksums
5fc9e99668cffeb01e08ab1d7c13c8a6a379854b7d6f593781db5d82d06ea2ca
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 16, 2026.

Transparency log

Release files / nsb_py-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL nsb_py-0.1.1-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
31851ceabd6dc90fbe31c4389e7f39dca23dc3b17ae4f1612607f48699228e73
BLAKE2b-256 checksum
How to use checksums
b761bb1daebc1777bd55770e45cc23a84d23140f3b4c3a8748922e49d115435d
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 16, 2026.

Transparency log

Release files / nsb_py-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL nsb_py-0.1.1-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
a014666409acbab294eb11f9ca5462dc0da0890fbe7d265d88746aa86bce71a7
BLAKE2b-256 checksum
How to use checksums
fe5d1383b76f0c8b335b6f2c373adebf7c9c4d7b34f7c8daed8e65538fcc1948
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 16, 2026.

Transparency log

Release files / nsb_py-0.1.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL nsb_py-0.1.1-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
80b7181a5e73614170ab7b702b985dec287a0527e414444fec7b4bfca8fead1a
BLAKE2b-256 checksum
How to use checksums
d944d77411d7d071869467ac42d39fa905ca1dbcf73ef97bc0ec839e112fb053
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 16, 2026.

Transparency log

Release files / nsb_py-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL nsb_py-0.1.1-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
109ce0229f06c6e8f3f61cd67b5996a4bad326b369752b6ac0437191aa74b658
BLAKE2b-256 checksum
How to use checksums
dce2c7838a2a31e89264372ab4b83d2a0e9c57d2d02d2368f04b26c77e6c5f8e
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 16, 2026.

Transparency log

Security for nsb-py 0.1.1

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.

Select from 6 files

Attestation for nsb_py-0.1.1.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 16, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page