Skip to content

standard_star_reference

Load a spectrophotometric standard (CALSPEC or Pickles template) as the catalogue spectrum.

Category External catalogues
Backend astropy - wraps the domain-standard astropy implementation
Version 1.0.0
Reads -
Writes extras.catalog_spectrum, catalog_lookups, metrics.reference_npix, metrics.reference_wavelength_min, metrics.reference_wavelength_max

source='calspec' : fetches (STScI archive.stsci.edu, current_calspec) through open_safe_url (SSRF guard, no redirects, timeout_s, max_bytes cap) and caches it in cache_dir (default /spectro-kernel-calspec ; refresh=true re-downloads). The filename comes from the filename parameter, or from a built-in name map that only knows Vega (alpha_lyr_stis_011.fits) — any other star needs filename. Columns WAVELENGTH (vacuum Å) and FLUX (erg/s/cm²/Å) are read ; STATERROR and SYSERROR, when present, are combined in quadrature into the uncertainty. to_air=true (default) converts the vacuum axis to air with the Morton 2000 relation above 2000 Å (below, the axis is left as is), so the reference matches a ground-based, air-calibrated observation ; set to_air=false when the observation is on a vacuum scale. source='pickles' : reads /.dat with pickles_atlas.load_atlas_from_dir (canonical 3800–7500 Å grid, 2 Å step) — a NORMALISED template (Pickles 1998 §3 : 'normalized to unity at 5556 Å' ; §5 : 'arbitrarily normalized to unity around 5556 Å, so the magnitude measurements are relative' ; flux_unit 'normalized', meta absolute_calibration=false) : the derived response has the right shape but an arbitrary scale (relative flux calibration only). The brick does NOT re-normalise the file ; it reports the value it finds at 5556 Å (flux_at_5556_aa in artifacts and meta — 1.0 for a genuine Pickles file, NaN when 5556 Å is outside the template). The CatalogResult is filed in ctx.catalog_lookups under name when given, else under the identifier (CALSPEC TARGETID or the Pickles template_id). Never fetches at import ; no network for source='pickles' or a cache hit.

Parameters

Parameter Default Required Description
name None - Star name (e.g. 'Vega') ; resolved through the built-in CALSPEC map.
source 'calspec' - 'calspec' (absolute, network) or 'pickles' (normalised template, local).
filename None - CALSPEC file name (e.g. 'alpha_lyr_stis_011.fits') ; required unless the name is in the built-in map.
atlas_dir None - Directory of Pickles uk*.dat files (source='pickles').
template_id None - Pickles template stem, e.g. 'uka0v' (source='pickles').
to_air True - Convert the CALSPEC vacuum wavelengths to air (Morton 2000) above 2000 Å.
cache_dir None - Directory caching downloaded CALSPEC files ; None ⇒ temp directory.
refresh False - Re-download even when the file is already in the cache.
timeout_s 60.0 - Socket timeout (s) of the download.
max_bytes 67108864 - Byte cap on the download.
output_key 'catalog_spectrum' - ctx.extras key receiving the reference Spectrum1D.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("standard_star_reference", ctx, {
    "name": None,
    "source": "calspec",
    "filename": None,
    "atlas_dir": None,
    "template_id": None,
    "to_air": True,
    "cache_dir": None,
    "refresh": False,
    "timeout_s": 60.0,
    "max_bytes": 67108864,
    "output_key": "catalog_spectrum"
})
spectro run standard_star_reference --input spectrum.fits \
  --param name=none \
  --param source=calspec \
  --param filename=none \
  --param atlas_dir=none \
  --param template_id=none \
  --param to_air=true \
  --param cache_dir=none \
  --param refresh=false \
  --param timeout_s=60.0 \
  --param max_bytes=67108864 \
  --param output_key=catalog_spectrum
{
  "tool": "standard_star_reference",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "name": null,
      "source": "calspec",
      "filename": null,
      "atlas_dir": null,
      "template_id": null,
      "to_air": true,
      "cache_dir": null,
      "refresh": false,
      "timeout_s": 60.0,
      "max_bytes": 67108864,
      "output_key": "catalog_spectrum"
    }
  }
}

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

References

  • Bohlin, Gordon & Tremblay 2014, PASP 126, 711 — CALSPEC absolute flux calibration (HST STIS / NICMOS / WFC3 standards).
  • Bohlin, Hubeny & Rauch 2020, AJ 160, 21 — CALSPEC update.
  • Pickles 1998, PASP 110, 863 — stellar spectral flux library (normalised templates).
  • Morton 2000, ApJS 130, 403 — vacuum → air conversion applied to the CALSPEC axis when to_air is true.
  • gaia_query - Cone-search the Gaia archive around ICRS coordinates.
  • simbad_query - Resolve an object name against SIMBAD and store the record in the context.
  • vizier_query - Look up an object in VizieR — the CDS table service.