hispecdrp.primitives.barycenter_correction.barycenter_corr
Functions
|
|
|
Convert |
|
Calculate the barycenter corrections for the input data using barycorrpy. |
|
Calculate the solar system barycenter corrections for the input data using barycorrpy. |
|
Extract the necessary stellar data from the input model for barycorrpy calculations. |
|
Return |
|
Return exposure |
|
Resolve the exposure CCF barycentric factor from |
Classes
|
- class BarycorrpyStarData(ra: float, dec: float, epoch: float = 2000.0, pm_ra: float = 0.0, pm_dec: float = 0.0, px: float = 0.0, rvsys: float = 0.0)[source]
Bases:
object
- _convert_epoch_gaia(ra, dec, epoch=2000.0, pmra=0.0, pmdec=0.0, px=0.0, rvsys=0.0, to_gaia=True, release='DR3')[source]
Convert epoch to Gaia epoch.
- Parameters:
ra (float) – Right ascension in degrees.
dec (float) – Declination in degrees.
epoch (float) – Epoch of the input coordinates (e.g., 2000.0).
pmra (float, optional) – Proper motion in RA (mas/yr).
pmdec (float, optional) – Proper motion in Dec (mas/yr).
px (float, optional) – Parallax (mas).
rvsys (float, optional) – Systemic Radial velocity (km/s).
to_gaia (bool, optional) – If True, convert to Gaia epoch; otherwise, convert from Gaia to the specified epoch.
release (str, optional) – The Gaia data release to use (default “DR3”).
- Returns:
tuple[float, float] – Converted right ascension and declination.
- _resolve_location(observatory)[source]
- berv_m_s_to_ccf_zb(berv_m_s)[source]
Convert
BARYCORRBERV(m/s) to the CCF barycentric factor \(z_b\).Matches
doppler_shift_from_barycenter()wherezb1 = 1 + z_band trial velocity enters asv / c.
- calc_barycenter_corrections(mjd_utc, star_data, observatory, zmeas=0.0)[source]
Calculate the barycenter corrections for the input data using barycorrpy.
- Parameters:
mjd_utc (float | Sequence[float]) – Modified Julian Date in UTC.
star_data (BarycorrpyStarData) – Stellar data required for barycenter correction calculation.
observatory (str | EarthLocation) – Observatory name or EarthLocation object for the observation.
zmeas (float, optional) – Measured redshift of the target, relevant for relativistic corrections. Default is 0.
- Returns:
mbjd (float) – Modified Barycentric Julian Date.
vel_bc (float) – Barycentric Earth Radial Velocity correction in m/s (
barycorrpyconvention).
- calc_solar_barycenter_corrections(mjd_utc, observatory=None)[source]
Calculate the solar system barycenter corrections for the input data using barycorrpy.
- Parameters:
mjd_utc (float) – Modified Julian Date in UTC.
- Returns:
mbjd (float) – Modified Barycentric Julian Date.
vel_bc (float) – Barycentric Earth Radial Velocity correction in m/s (
barycorrpyconvention).
- get_barycorrpy_star_data(input_model)[source]
Extract the necessary stellar data from the input model for barycorrpy calculations.
- Parameters:
input_model (datamodels.L2Model) – The input data model containing the necessary metadata.
- Returns:
BarycorrpyStarData – A dataclass containing the extracted stellar data.
- read_berv_m_s_from_model(input_model, fiber)[source]
Return
BERV(m/s) fromBARYCORR_FIB#, orNonewhen unavailable.
- read_berv_m_s_uniform_from_model(input_model)[source]
Return exposure
BERV(m/s) from the first populatedBARYCORR_FIB#table.HISPEC barycentric corrections are not resolved per fiber at the precision relevant for CCF; one value applies to all fibers on the exposure.
- resolve_ccf_zb(input_model, *, ccf_zb=0.0)[source]
Resolve the exposure CCF barycentric factor from
BARYCORR.When any
BARYCORR_FIB#table is populated,BERV(m/s) is converted to dimensionless \(z_b\) and applied uniformly to all fibers. Otherwise returnsccf_zb.