EclipsingSystem

class rocky_worlds_data_challenge.EclipsingSystem(rprs: ArrayLike | float = None, per: ArrayLike | float = None, depth_ecl: ArrayLike | float = None, t_ecl: ArrayLike | float = None, t_tra: ArrayLike | float = None, a: ArrayLike | float = None, inc: ArrayLike | float = None, b_tra: ArrayLike | float = None, b_ecl: ArrayLike | float = None, rs: ArrayLike | float = None, omega: ArrayLike | float = None, ecc: ArrayLike | float = None, ecosw: ArrayLike | float = None, esinw: ArrayLike | float = None, secosw: ArrayLike | float = None, sesinw: ArrayLike | float = None, rho_star: ArrayLike | float = None, dur_tra: ArrayLike | float = None, dur_ecl: ArrayLike | float = None, **parameter_aliases)[source]

Bases: object

Infer and validate eclipse-system parameters from posterior samples.

The class accepts several equivalent orbital parameterizations and fills in derived values such as eccentricity, impact parameters, conjunction times, durations, and stellar density where the supplied inputs make those conversions possible.

The canonical planet-to-star radius ratio parameter is rprs. The aliases rp_rs, rp/rs, rp/rstar, k, and radius_ratio are normalized to rprs. A fractional transit depth supplied as depth_tra or transit_depth is converted to rprs = sqrt(depth_tra).

Variables:
  • rprs (array-like or float) – Planet-to-star radius ratio.

  • per (array-like or float) – Orbital period in days.

  • depth_ecl (array-like or float) – Eclipse depth in parts per million. This value is required.

  • t_ecl (array-like or float) – Mid-eclipse time in BMJD_TDB.

  • t_tra (array-like or float) – Mid-transit time in BMJD_TDB.

  • a (array-like or float) – Semimajor axis in units of stellar radii.

  • inc (array-like or float) – Planetary orbital inclination in degrees.

  • b_tra (array-like or float) – Impact parameter at transit in units of stellar radii.

  • b_ecl (array-like or float) – Impact parameter at eclipse in units of stellar radii.

  • rs (array-like or float) – Stellar radius in units of solar radii.

  • omega (array-like or float) – Longitude of periastron in degrees.

  • ecc (array-like or float) – Orbital eccentricity.

  • ecosw (array-like or float) – Eccentricity times the cosine of longitude of periastron.

  • esinw (array-like or float) – Eccentricity times the sine of longitude of periastron.

  • secosw (array-like or float) – Square root of eccentricity times the cosine of longitude of periastron.

  • sesinw (array-like or float) – Square root of eccentricity times the sine of longitude of periastron.

  • rho_star (array-like or float) – Stellar density in units of the solar density.

  • dur_tra (array-like or float) – Transit duration from first through fourth contact, in days.

  • dur_ecl (array-like or float) – Eclipse duration from first through fourth contact, in days.

Initialize an eclipsing-system parameter set.

Parameters are the canonical dataclass fields documented above. Additional keyword arguments may include supported aliases, such as rp_rs, k, or a fractional transit_depth.

Attributes Summary

a

Semimajor axis in units of stellar radii.

b_ecl

Impact parameter at eclipse in units of stellar radii.

b_tra

Impact parameter at transit in units of stellar radii.

depth_ecl

Eclipse depth in parts per million.

dur_ecl

Eclipse duration from first through fourth contact, in days.

dur_tra

Transit duration from first through fourth contact, in days.

ecc

Orbital eccentricity.

ecosw

Eccentricity times the cosine of longitude of periastron.

esinw

Eccentricity times the sine of longitude of periastron.

inc

Planetary orbital inclination in degrees.

omega

Longitude of periastron in degrees.

per

Orbital period in days.

rho_star

Stellar density in units of the solar density.

rprs

Planet-to-star radius ratio.

rs

Stellar radius in units of solar radii.

secosw

Square root of eccentricity times cosine of longitude of periastron.

sesinw

Square root of eccentricity times sine of longitude of periastron.

t_ecl

Mid-eclipse time in BMJD_TDB.

t_tra

Mid-transit time in BMJD_TDB.

Methods Summary

from_posteriors(samples, parameter_keys)

Build an eclipsing system from one posterior draw and its keys.

get_a_inc()

Return semimajor axis in stellar radii and inclination.

get_b()

Return the transit and eclipse impact parameters.

get_conjunction_times()

Return the mid-transit and mid-eclipse times.

get_durations()

Return first-to-fourth-contact transit and eclipse durations.

get_ecc_omega()

Return eccentricity and longitude of periastron.

validate()

Check required inputs and derive all supported dependent values.

Attributes Documentation

a: ArrayLike | float

Semimajor axis in units of stellar radii.

b_ecl: ArrayLike | float

Impact parameter at eclipse in units of stellar radii.

b_tra: ArrayLike | float

Impact parameter at transit in units of stellar radii.

depth_ecl: ArrayLike | float

Eclipse depth in parts per million.

dur_ecl: ArrayLike | float

Eclipse duration from first through fourth contact, in days.

dur_tra: ArrayLike | float

Transit duration from first through fourth contact, in days.

ecc: ArrayLike | float

Orbital eccentricity.

ecosw: ArrayLike | float

Eccentricity times the cosine of longitude of periastron.

esinw: ArrayLike | float

Eccentricity times the sine of longitude of periastron.

inc: ArrayLike | float

Planetary orbital inclination in degrees.

omega: ArrayLike | float

Longitude of periastron in degrees.

per: ArrayLike | float

Orbital period in days.

rho_star: ArrayLike | float

Stellar density in units of the solar density.

rprs: ArrayLike | float

Planet-to-star radius ratio.

rs: ArrayLike | float

Stellar radius in units of solar radii.

secosw: ArrayLike | float

Square root of eccentricity times cosine of longitude of periastron.

sesinw: ArrayLike | float

Square root of eccentricity times sine of longitude of periastron.

t_ecl: ArrayLike | float

Mid-eclipse time in BMJD_TDB.

t_tra: ArrayLike | float

Mid-transit time in BMJD_TDB.

Methods Documentation

classmethod from_posteriors(samples, parameter_keys)[source]

Build an eclipsing system from one posterior draw and its keys.

Parameters:
  • samples (array-like) – One posterior draw containing one value for each parameter.

  • parameter_keys (array-like) – Parameter names corresponding to samples.

Returns:

System initialized with the supplied posterior values.

Return type:

EclipsingSystem

get_a_inc()[source]

Return semimajor axis in stellar radii and inclination.

The inclination is returned in degrees.

Returns:

  • a (array-like or float) – Semimajor axis in units of stellar radii.

  • inc (array-like or float) – Orbital inclination in degrees.

get_b()[source]

Return the transit and eclipse impact parameters.

Returns:

  • b_tra (array-like or float) – Transit impact parameter in units of stellar radii.

  • b_ecl (array-like or float) – Eclipse impact parameter in units of stellar radii.

get_conjunction_times()[source]

Return the mid-transit and mid-eclipse times.

Returns:

  • t_tra (array-like or float) – Mid-transit time in BMJD_TDB.

  • t_ecl (array-like or float) – Mid-eclipse time in BMJD_TDB.

get_durations()[source]

Return first-to-fourth-contact transit and eclipse durations.

Returns:

  • dur_tra (array-like or float) – Transit duration in days.

  • dur_ecl (array-like or float) – Eclipse duration in days.

get_ecc_omega()[source]

Return eccentricity and longitude of periastron.

The method accepts any one of three equivalent parameterizations: ecc/omega, ecosw/esinw, or secosw/sesinw. Missing companion eccentricity parameters are filled in place when possible.

Returns:

  • ecc (array-like or float) – Orbital eccentricity.

  • omega (array-like or float) – Longitude of periastron in degrees.

Raises:

ValueError – If no supported eccentricity/orientation parameterization has been provided.

validate()[source]

Check required inputs and derive all supported dependent values.

Raises:

ValueError – If depth_ecl is missing or if required orbital quantities cannot be derived from the supplied parameterization.