Skip to content

barycentric_correction

Compute the barycentric (or heliocentric) correction and Julian date, and shift the spectrum.

Category Corrections
Backend astropy - wraps the domain-standard astropy implementation
Version 1.1.0
Reads ctx.spectrum (a Spectrum1D)
Writes metrics.barycentric_velocity_kms, metrics.bjd_tdb, spectrum

The observer location defaults to the geocentre; set latitude/longitude/elevation for the diurnal term (up to ~0.5 km/s). Uses astropy's SkyCoord.radial_velocity_correction and Time.light_travel_time. kind='barycentric' (default) emits metrics.bjd_tdb and a BJD_TDB header card; kind='heliocentric' emits metrics.hjd_utc, an HJD card and the BeSS BSS_VHEL card (BSS_VHEL is heliocentric by definition — the kernel refuses to fill it from a barycentric velocity, the two differ by up to ~13 m/s). BSS_VHEL carries the applied velocity when apply_shift is true, else 0 (BeSS convention for an uncorrected product). The Julian date is computed at MID-exposure: start time + exposure_seconds/2, falling back to the FITS EXPTIME when the parameter is null, and to 0 (start = mid) when neither exists.

Parameters

Parameter Default Required Description
ra_deg None - Target right ascension (deg); falls back to the FITS RA keyword.
dec_deg None - Target declination (deg); falls back to the FITS DEC keyword.
obstime None - Start-of-exposure time (ISO-8601); falls back to FITS DATE-OBS.
latitude_deg 0.0 - Observer geodetic latitude (deg).
longitude_deg 0.0 - Observer geodetic longitude (deg, east positive).
elevation_m 0.0 - Observer elevation above the ellipsoid (m).
apply_shift True - If true, Doppler-shift the wavelength axis to the chosen frame.
kind 'barycentric' - 'barycentric' (default; emits BJD_TDB) or 'heliocentric' (emits HJD and the BeSS BSS_VHEL card).
exposure_seconds None - Exposure duration (s), used to compute the Julian date at mid-exposure; null falls back to the FITS EXPTIME keyword, then to 0.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("barycentric_correction", ctx, {
    "ra_deg": None,
    "dec_deg": None,
    "obstime": None,
    "latitude_deg": 0.0,
    "longitude_deg": 0.0,
    "elevation_m": 0.0,
    "apply_shift": True,
    "kind": "barycentric",
    "exposure_seconds": None
})
spectro run barycentric_correction --input spectrum.fits \
  --param ra_deg=none \
  --param dec_deg=none \
  --param obstime=none \
  --param latitude_deg=0.0 \
  --param longitude_deg=0.0 \
  --param elevation_m=0.0 \
  --param apply_shift=true \
  --param kind=barycentric \
  --param exposure_seconds=none
{
  "tool": "barycentric_correction",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "ra_deg": null,
      "dec_deg": null,
      "obstime": null,
      "latitude_deg": 0.0,
      "longitude_deg": 0.0,
      "elevation_m": 0.0,
      "apply_shift": true,
      "kind": "barycentric",
      "exposure_seconds": null
    }
  }
}

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

References

  • astropy.coordinates SkyCoord.radial_velocity_correction
  • Wright & Eastman 2014, PASP 126, 838 — barycentric correction precision
  • Eastman, Siverd & Gaudi 2010, PASP 122, 935 — BJD_TDB as the unambiguous time standard (HJD/UTC ambiguities reach the minute).