Barycentric correction

The algorithm derives the barycentric correction of an observation, i.e. the wavelength shift to apply to a spectrum to compensate for the motion of the observer with respect to the barycenter of the solar system, by using the ERFA (Essential Routines for Fundamental Astronomy) library. ERFA is a C library containing key algorithms for astronomy, and is based on the SOFA library published by the International Astronomical Union (IAU).

In PyHDRL this is hdrl.func.Barycorr. The computation is a static method Barycorr.compute().

Algorithm

The implemented algorithm uses the ERFA function eraApco13() to calculate the barycentric correction of an observation.

A comparison between the algorithm implemented in HDRL and the one implemented in the ESPRESSO pipeline shows a very good agreement. For this about 7000 IDPs from 2021 were re-analyzed with the HDRL implementation and the differences read as follows:

  • Mean difference: 0.036 m/s

  • Median difference: 0.055 m/s

  • Standard deviation: 0.281 m/s

  • MAD (median absolute deviation): 0.217 m/s

  • Maximum deviation: 1.573 m/s

Inputs

  • target: tuple (ra, dec) in degrees (J2000)

  • observer: tuple (lat, lon, height) where latitude and longitude are in degrees and height is in metres

  • eop_table: cpl.core.Table containing the Earth Orientation Parameters

  • mjd_obs: Modified Julian Date of the observation

  • time_to_mid_exposure: time to mid exposure in seconds (e.g. EXPTIME/2)

  • pressure: atmospheric pressure in hPa (optional, default 0.0)

  • temperature: ambient temperature in degrees Celsius (optional, default 0.0)

  • humidity: relative humidity, range 0–1 (optional, default 0.0)

  • wavelength: observing wavelength in micrometers (optional, default 0.0)

The pressure, temperature, humidity, and wavelength parameters are only tested with a value of 0. No tests with other values were performed.

The function returns the barycentric correction in m/s.

barycorr = hdrl.func.Barycorr.compute(
    target=(ra, dec),
    observer=(lat, lon, elev),
    eop_table=eop_table,
    mjd_obs=mjd,
    time_to_mid_exposure=0.0,
)