Skip to content

flux_calibrate_easyspec

Flux-calibrate ctx.spectrum via a standard-star observation.

Category Flux calibration
Backend easyspec - wraps the EasySpec reduction library (optional extra reduction)
Version 1.0.1
Reads ctx.spectrum (a Spectrum1D)
Writes spectrum

Use list_available_standards() from easyspec.extraction to find the archive datasets it bundles (calspec, oke1990, irscal, …). The target spectrum on ctx.spectrum must be wavelength-calibrated and extinction-corrected before this step.

Parameters

Parameter Default Required Description
std_star_wavelength_angstrom None yes Wavelength axis (Å) of the standard star's extinction-corrected spectrum.
std_star_flux_extinction_corrected None yes Flux of the standard star, already corrected for atmospheric extinction.
std_star_dataset 'calspec' - Archive name bundled with easyspec (e.g. calspec, oke1990).
std_star_archive_file None yes Reference file inside the chosen dataset (e.g. alpha_lyr_stis_011.dat).
exposure_target_seconds None yes Exposure time of the target observation (s).
exposure_std_star_seconds None yes Exposure time of the standard-star observation (s).
smooth_window 101 - Smoothing window for the observed/archive ratio.
smooth_window_archive 11 - Smoothing window for the archive spectrum before division.
reddening_ebv None - Optional interstellar E(B-V) to apply (CCM/F99 inside easyspec).
rv_extinction None - R_V to pair with reddening_ebv (default ~3.1 if unset).
save_output False - If true, let easyspec write its diagnostic FITS to the temp dir.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("flux_calibrate_easyspec", ctx, {
    "std_star_wavelength_angstrom": "<value>",
    "std_star_flux_extinction_corrected": "<value>",
    "std_star_dataset": "calspec",
    "std_star_archive_file": "<value>",
    "exposure_target_seconds": "<value>",
    "exposure_std_star_seconds": "<value>",
    "smooth_window": 101,
    "smooth_window_archive": 11,
    "reddening_ebv": None,
    "rv_extinction": None,
    "save_output": False
})
spectro run flux_calibrate_easyspec --input spectrum.fits \
  --param std_star_wavelength_angstrom=<value> \
  --param std_star_flux_extinction_corrected=<value> \
  --param std_star_dataset=calspec \
  --param std_star_archive_file=<value> \
  --param exposure_target_seconds=<value> \
  --param exposure_std_star_seconds=<value> \
  --param smooth_window=101 \
  --param smooth_window_archive=11 \
  --param reddening_ebv=none \
  --param rv_extinction=none \
  --param save_output=false
{
  "tool": "flux_calibrate_easyspec",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "std_star_wavelength_angstrom": "<value>",
      "std_star_flux_extinction_corrected": "<value>",
      "std_star_dataset": "calspec",
      "std_star_archive_file": "<value>",
      "exposure_target_seconds": "<value>",
      "exposure_std_star_seconds": "<value>",
      "smooth_window": 101,
      "smooth_window_archive": 11,
      "reddening_ebv": null,
      "rv_extinction": null,
      "save_output": false
    }
  }
}

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

References

  • easyspec.extraction.extraction.std_star_normalization.
  • easyspec.extraction.extraction.target_flux_calibration.