Skip to content

validate_bess_header

Check a FITS header against the BeSS keyword contract.

Category Quality / SNR
Backend numpy - implemented here on top of numpy primitives
Version 1.0.0
Reads -
Writes metrics.bess_compliant

The mirror of export_fits_bess: both bricks consume the same keyword table (algorithms.exports._bess_contract), so a file produced by the exporter always validates cleanly. Checks: NAXIS == 1 and NAXIS1 > 0; spectral WCS (CRVAL1, CDELT1, CRPIX1, CTYPE1, CUNIT1) present and non-empty; BeSS identification (BSS_INST, BSS_SITE, BSS_ESRC) and observation keywords (OBJNAME, DATE-OBS, EXPTIME, OBSERVER) present and non-empty; BSS_VHEL present (value 0 licit). strict=false reports without failing — refusing a product is application policy, not kernel policy.

Parameters

Parameter Default Required Description
strict False - If true, the step fails when the header is non-conforming; if false (default), issues are reported and the step succeeds.
header_key None - Optional ctx.extras key holding the header dict to check; null reads ctx.spectrum.header.
require_geo False - Also require observing-site coordinates (BSS_LAT/GEO_LAT, BSS_LONG/GEO_LONG, BSS_ELEV/GEO_ELEV) — optional in BeSS but mandatory for a STAROS deposit.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("validate_bess_header", ctx, {
    "strict": False,
    "header_key": None,
    "require_geo": False
})
spectro run validate_bess_header --input spectrum.fits \
  --param strict=false \
  --param header_key=none \
  --param require_geo=false
{
  "tool": "validate_bess_header",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "strict": false,
      "header_key": null,
      "require_geo": false
    }
  }
}

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

References

  • Teyssier 2015, A&A Pro-Am collaboration — BeSS/ARAS submission protocol.
  • Buil 2012, ARAS Observation Guide — BeSS FITS header convention.
  • FITS Standard 4.0 — Pence et al. 2010, A&A 524, A42.
  • compare_snr_methods - Run every SNR estimator on ctx.spectrum and collect their numbers.
  • snr_der - Derivative-based SNR estimator (DER_SNR, Stoehr et al. 2008).
  • snr_edge - Estimate SNR from the flat, line-free regions at the spectrum's edges.
  • snr_linear_fit - Estimate SNR from the scatter around a linear fit of a continuum region.