Skip to content

embed_band_power

Embed a spectrum as the integrated flux in N adjacent wavelength bands.

Category Embeddings
Backend numpy - implemented here on top of numpy primitives
Version 2.0.1
Reads ctx.spectrum (a Spectrum1D)
Writes embedding, extras.embedding_provenance, metrics.embedding_dim, metrics.embedding_norm

Equivalent to converting a spectrum into a 'virtual photometric catalogue' with N synthetic broad bands. Very cheap and well-suited to indexing very heterogeneous datasets (different dispersions, resolutions, telescopes). Non-finite (NaN/inf) samples are dropped before integration — the trapezoidal band integral uses the actual wavelengths, so this is sampling-independent — and a descending wavelength axis is sorted first (band edges are taken from the finite samples).

Parameters

Parameter Default Required Description
n_bands 16 - Number of bands; also the output dim. Typically 8–32.
spacing 'log' - Band edges in wavelength: 'linear' or 'log'.
log_flux True - Take log10(integrated_flux + epsilon) before L2 norm.
epsilon 1e-12 - Small floor added before log_flux to keep zero bands finite.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("embed_band_power", ctx, {
    "n_bands": 16,
    "spacing": "log",
    "log_flux": True,
    "epsilon": 1e-12
})
spectro run embed_band_power --input spectrum.fits \
  --param n_bands=16 \
  --param spacing=log \
  --param log_flux=true \
  --param epsilon=1e-12
{
  "tool": "embed_band_power",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "n_bands": 16,
      "spacing": "log",
      "log_flux": true,
      "epsilon": 1e-12
    }
  }
}

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

References

  • Connolly et al. 1995, AJ, 110, 1071 — photometric SED classification.
  • Bolzonella et al. 2000, A&A, 363, 476 — band-power feature vectors for spectro-photometric classification.