Skip to content

read_ascii_spectrum

Read a 1D spectrum from a two- or three-column text file.

Category Input / output
Backend numpy - implemented here on top of numpy primitives
Version 1.0.0
Reads -
Writes spectrum

Parameters

Parameter Default Required Description
path None yes Local path of the text file to read.
delimiter None - Column delimiter; null auto-detects comma/semicolon/tab/whitespace.
flux_unit 'ADU' - Label recorded as the spectrum's flux unit.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("read_ascii_spectrum", ctx, {
    "path": "<value>",
    "delimiter": None,
    "flux_unit": "ADU"
})
spectro run read_ascii_spectrum --input spectrum.fits \
  --param path=<value> \
  --param delimiter=none \
  --param flux_unit=ADU
{
  "tool": "read_ascii_spectrum",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "path": "<value>",
      "delimiter": null,
      "flux_unit": "ADU"
    }
  }
}

Every algorithm is an MCP tool of the same name; describe_algorithm returns this page's metadata as JSON.

  • read_echelle_fits - Read a multi-order échelle FITS file into ctx.spectra.
  • read_fits - Read a 1D spectrum from a FITS file (local path or http(s) URL).
  • read_sdss_spectrum - Read an SDSS-format spectrum (spec-*.fits) into ctx.spectrum.
  • read_votable_spectrum - Read a 1D spectrum from a VOTable file (the IVOA Virtual Observatory format).