Skip to main content

noobase

Foundational pure-function utilities for astronomy analysis. Rust core with Python bindings via PyO3.

Status: pre-1.0, API unstable. Breaking changes expected between minor versions.

Install

pip install noobase

Requires Python 3.12 or newer. Wheels are published for linux-x86_64, macos-arm64, and windows-x86_64; a source distribution is also available.

Quick start

import numpy as np
import noobase

wavelength = np.linspace(1.0, 5.0, 200)
flux = np.exp(-((wavelength - 3.0) ** 2) / 0.5)
error = 0.01 * np.ones_like(flux)

spectrum = noobase.spectroscopy.Spectrum(
    wavelength=wavelength,
    flux=flux,
    error=error,
    spacing="linear",
    kind="centers",
)

transmission_grid = np.linspace(2.5, 3.5, 50)
transmission_values = np.exp(-((transmission_grid - 3.0) ** 2) / 0.05)

band_flux, band_error, coverage = spectrum.synthetic_photometry(
    transmission_grid=transmission_grid,
    transmission_values=transmission_values,
    convention="photon_counting",
)

What's in the box

  • axis.Grid — 1-D monotonic axis (linear / log, centers / edges)
  • axis.overlap.{rebin, rebin_variance, coverage} — overlap-weighted rebin primitives between two axis grids
  • convolve.{gaussian1d, conv1d, conv_axis, conv2d, conv2d_renorm, conv_axis_renorm} — bare correlation kernels plus NaN-as-missing renormalized variants
  • spectroscopy.Spectrum — wavelength + flux + optional error + optional mask, with rebinning, flux density convention conversion, and noise-free-template LSF broadening via Spectrum.convolve_lsf
  • spectroscopy.synthetic_photometry.{synthetic, SyntheticOperator} — synthetic photometry through transmission curves; the cached operator is suited for MCMC hot loops
  • image.reproject_exact — surface-brightness-conserving image reprojection via planar polygon clipping (rayon-parallel; WCS handling stays in the caller's astropy / gwcs)
  • image.make_pixel_corners — turn a pair of pixel_to_world_values / world_to_pixel_values callables (astropy.wcs or gwcs) into the corner array consumed by reproject_exact, with optional coarse_step for expensive WCS chains
  • image.convolve_psf — true 2-D PSF convolution with NaN-as-missing edge / mask renormalization
  • image.convolve_gaussian_axis — 1-D Gaussian axis correlation for grism-style matched filtering
  • image.build_stamp — recenter a point-source cutout into a fixed stamp (sub-pixel centroid recorded, not applied)
  • image.psf.build_epsf — oversampled ePSF from a stack of under-sampled stamps via projected Landweber / Irani–Peleg super-resolution
  • image.psf.build_extended_psf — bright-star wing stacking + core↔wing stitch into an encircled-energy-normalised extended PSF, with robust_combine / solve_flux_background / stitch_psf exposed as leaves
  • aperture.grow_mask — adaptive aperture mask grown by a heap-driven greedy loop from one or more seed pixels, terminated by an inner-annulus SNR stop and a radial-gradient stop (each with independent hysteresis); accepts an optional segmentation label_map + label_allowed whitelist to keep the mask inside the source's pre-computed segmentation

Convolution examples

template = noobase.spectroscopy.Spectrum(
    wavelength=wavelength,
    flux=flux,
    spacing="linear",
    kind="centers",
)
broadened = template.convolve_lsf(spec="constant_r", resolving_power=3000.0)

psf = psf / psf.sum()
model_image = noobase.image.convolve_psf(image, psf)

line_response = noobase.image.convolve_gaussian_axis(
    image,
    sigma=2.5,
    axis=0,
    normalization="l2",
)

See the full project README on GitHub for the complete feature list, the workspace layout, and the development workflow.

License

MIT.

Metadata

Release files for noobase 0.0.8

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

Source distribution (sdist)

Source distribution for noobase 0.0.8
File Size Uploaded Provenance Actions
noobase-0.0.8.tar.gz 267.9 kB Without provenance Details for noobase-0.0.8.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for noobase 0.0.8
File Interpreter ABI Platform Actions
noobase-0.0.8-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for noobase-0.0.8-cp312-abi3-win_amd64.whl
noobase-0.0.8-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for noobase-0.0.8-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
noobase-0.0.8-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for noobase-0.0.8-cp312-abi3-macosx_11_0_arm64.whl

Total release size: 2.2 MB

Release files / noobase-0.0.8.tar.gz

Download URL noobase-0.0.8.tar.gz
Size 267.9 kB
Tags Source
SHA-256 checksum
How to use checksums
69edc91b7d70afe35d6678d3a98b87a029644294330f14f593c5fb605b981c00
BLAKE2b-256 checksum
How to use checksums
0bcc430f30c17ab6d609f7e7e56eeecc280a7dfc0b55e4f94163846f0631b3e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / noobase-0.0.8-cp312-abi3-win_amd64.whl

Download URL noobase-0.0.8-cp312-abi3-win_amd64.whl
Size 601.1 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
11fd18280edb1093bbce9a353ea633ad8c3adb1da5a671b61d224447582e4747
BLAKE2b-256 checksum
How to use checksums
f17465dc8990eff33abc63b83bdac2e53f74acf16b20bd5999e8d945b118eb52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / noobase-0.0.8-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL noobase-0.0.8-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 715.4 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c262a450216cdbac737499786d4db17adbe5b5f05ab0cfbaa53f56d6aa4a2797
BLAKE2b-256 checksum
How to use checksums
91f59d8b0464b74190733f06434385073399febaaf02e947fc1ce624a9c99610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / noobase-0.0.8-cp312-abi3-macosx_11_0_arm64.whl

Download URL noobase-0.0.8-cp312-abi3-macosx_11_0_arm64.whl
Size 634.5 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1c607c13106d558b5cea60c200ab1cd492a69e37ed42757cf582b7d6c815eb39
BLAKE2b-256 checksum
How to use checksums
86c08572cc4768071c17ded248d9cb32a215950fe7028701e2e1654420d62ea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Security for noobase 0.0.8

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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