Skip to content

spectro-kernel

A shared, discoverable catalogue of astronomical spectroscopy algorithms - composable into reproducible pipelines, usable as a Python library, a command-line tool, or an MCP server for AI agents.


In one paragraph

Every spectroscopy project re-implements the same operations - reading a FITS file, normalising a continuum, measuring a signal-to-noise ratio, fitting a line - and each re-implementation drifts a little, until results from two apps can no longer be compared. spectro-kernel fixes that: each operation is implemented once, tested once, documented once, and made available everywhere - to your Python code, to a terminal, and to an AI agent - through a single catalogue.

It does not replace astropy or specutils. It stands on them. See Why spectro-kernel? for exactly what it adds and why.

Three doors, one room

flowchart TD
    subgraph Doors["Three ways in - same catalogue behind all of them"]
        LIB["Python library<br/><code>import spectro_kernel</code>"]
        CLI["Command line<br/><code>spectro …</code>"]
        MCP["MCP server<br/><code>spectro-mcp</code> (AI agents)"]
    end
    REG["The registry<br/>one catalogue of algorithms"]
    LIB --> REG
    CLI --> REG
    MCP --> REG
    REG --> KERNEL["spectro-kernel<br/>types · pipelines · I/O"]
    KERNEL --> DEPS["astropy · numpy · scipy · (specutils, astroquery, plotly)"]

Functional parity between the three doors is a hard rule: anything an AI agent can do through MCP, you can do from a terminal, and vice-versa.

Where to go next

  • Why spectro-kernel? - what it adds on top of astropy/specutils, and the "we don't reinvent" principle.
  • Getting started - install and run your first analysis in five minutes.
  • Concepts - the architecture, the data types, the registry, the pipelines.
  • Algorithm catalogue - every algorithm, auto-generated from the code.
  • Tutorials - from "I captured a spectrum of a star, now what?" all the way to writing your own algorithm.

Status

v0.2.0 - alpha. The catalogue covers ~97 algorithms across image-frame reduction (bias / dark / flat, geometric rectification, denoising, cosmic-ray clipping, sky subtraction, trace extraction), wavelength & flux calibration (arc-lamp polynomial, in-situ from sky lines, solar Fraunhofer), 1-D analysis (continuum, smoothing, line fitting, radial velocity, time series), embeddings, exports (FITS / CSV / VOTable / HDF5 / BeSS), and visualisation. The API may change until v1.0.0. See the changelog for release notes.