demographics

Documentation for demographics.

demographics.KEPLER_DR25_PARAMSConstant

Kepler DR25 detection coefficients for calculating detection probability, given number of transits and expected SNR. Taken from Hsu et al. (2019)

source
demographics.ctl_advanced_searchMethod
ctl_advanced_search(filter_param::String, min_val::T, max_val::T) where T<:AbstractFloat -> nothing

Arguments

  • filter_param::String: The parameter name to filter on.
  • min_val::T: The minimum value for the filter.
  • max_val::T: The maximum value for the filter.

Returns

  • nothing

Description

Perform an advanced search on the CTL catalog using the specified filter parameter and value range, and print the count of matching sources.

source
demographics.ctl_advanced_search_rowsMethod
ctl_advanced_search_rows(filter_param::String, min_val::T, max_val::T, columns::String) where T<:AbstractFloat -> out_data

Arguments

  • filter_param::String: The parameter name to filter on.
  • min_val::T: The minimum value for the filter.
  • max_val::T: The maximum value for the filter.
  • columns::String: Comma-separated string of columns to retrieve.

Returns

  • out_data::Dict: The parsed JSON response containing the requested rows.

Description

Perform an advanced search on the CTL catalog using the specified filter parameter and value range, and retrieve the specified columns.

source
demographics.draw_inclination_angleMethod
draw_inclination_angle(N) -> cosi_array

Arguments

  • N::Int: Number of planets.

Returns

  • cosi_array: Array of cosine of inclination angle for the planets.

Description

Draw inclination angles cosine for N planets from a uniform distribution between 0 and 1

source
demographics.draw_num_planetsMethod
draw_num_planets(meanN) -> num_planets

Arguments

  • meanN::Float64: Mean number of planets per star.

Returns

  • num_planets::Int: number of actual planets for one star.

Description

Draw the number of planets for one star from a Poisson distribution with mean ⟨N⟩.

source
demographics.draw_orbital_eccentricityMethod
draw_orbital_eccentricity(N,α,β) -> e_array

Arguments

  • N::Int: Number of planets.
  • α::Float64: Alpha parameter for the Beta distribution.
  • β::Float64: Beta parameter for the Beta distribution.

Returns

  • e_array: Array of orbital eccentricities for the planets.

Description

Draw orbital eccentricities for N planets from a Beta distribution with parameters α and β. Van Eylen & Albrecht 2015

source
demographics.draw_periastron_angleMethod
draw_periastron_angle(N) -> ω_array

Arguments

  • N::Int: Number of planets.

Returns

  • ω_array: Array of periastron angles for the planets.

Description

Draw periastron angles for N planets from a uniform distribution between -π and π

source
demographics.get_P_detMethod
get_P_det(x,C,A,B) -> P_det

Arguments

  • x::Float64: expected SNR of the transiting planet
  • c::Float64: maximum detection probability at high SNR
  • α::Float64: gamma function parameter (depend on number of transit)
  • β::Float64: gamma function parameter (depend on number of transit)

Returns

  • P_det::Float64: detection probability

Description

Calculates the detection probability of a transiting planet given a SNR, unlike simple assumptions of detection of planet based on SNR, this takes a probabilistic approach. Hsu et al. (2019)

source
demographics.hr_cdppMethod

hr_cdpp(T)

Arguments

  • T::Float64: TESS magnitude of the star.

Returns

  • Float64: 1-hour CDPP in ppm.

Description

  • Calculate one hour CDPP to get detectibility metric for TESS data.
  • Equation 1 from Kunimoto et al. (2022).
source
demographics.impact_parameterMethod
impact_parameter(a,cosi,e,Rₛ,ω) -> b

Arguments

  • a::Float64: Semi-major axis of the planet's orbit.
  • cosi::Float64: Cosine of the inclination angle.
  • e::Float64: Orbital eccentricity.
  • Rₛ::Float64: Radius of the star.
  • ω::Float64: Periastron angle.

Returns

  • b::Float64: Impact parameter of the transit.

Description

Calculate the impact parameter of a transiting exoplanet given its orbital parameters and the host star's radius.

source
demographics.mass_ratio_simMethod
mass_ratio_sim(q_max, q_min, n) -> q_mean

Arguments

  • q_max::Float64: Maximum mass ratio (planet mass / star mass).
  • q_min::Float64: Minimum mass ratio (planet mass / star mass).
  • n::Float64: Power-law index for the mass ratio distribution.

Returns

  • q_mean::Float64: Mean of planet star mass ratio.

Description

Calculate mean planet/star mass ratio from distribution parameter. Priyadarshi et. al. (2025)

source
demographics.mast_queryMethod
mast_query(request::Dict) -> head,content

Arguments

  • request::Dict: A dictionary representing the MAST API request.

Returns

  • head::Dict: The header of the MAST API response.
  • content::Dict: The content of the MAST API response.

Description

Send a POST request to the MAST API with the given request dictionary and return the response header and content.

source
demographics.mean_planet_NMethod
mean_planet_N(β, q_mean) -> N

Arguments

  • β::Float64: sum of all planet mass / stellar mass.
  • q_mean::Float64: Mean of planet star mass ratio.

Returns

  • N::Float64: Mean number of planets per star.

Description

Calculates mean of number of planets around a star based on mean mass. Priyadarshi et. al. (2025)

source
demographics.orbit_seperation_simMethod
orbit_seperation_sim(a_max, a_min, n) -> a_mean

Arguments

  • a_max::Float64: Maximum orbital separation.
  • a_min::Float64: Minimum orbital separation.
  • n::Float64: Power-law index for the orbital separation distribution.

Returns

  • a::Float64: Mean of orbital separation.

Description Calculate mean orbit seperation of planet distribution from parameters. Priyadarshi et. al. (2025)

source
demographics.random_a_simMethod
random_a_sim(u, a_max, a_min, n) -> a

Arguments

  • u::Float64: Random uniform variable between 0 and 1.
  • a_max::Float64: Maximum orbital separation.
  • a_min::Float64: Minimum orbital separation.
  • n::Float64: Power-law index for the orbital separation distribution.

Returns

  • a::Float64: Randomly sampled orbital separation.

Description

Returns a randomly sampled orbit seperation value based on the distribution.

source
demographics.random_q_simMethod
random_q_sim(u, q_max, q_min, n) -> q

Arguments

  • u::Float64: Random uniform variable between 0 and 1.
  • q_max::Float64: Maximum mass ratio (planet mass / star mass).
  • q_min::Float64: Minimum mass ratio (planet mass / star mass).
  • n::Float64: Power-law index for the mass ratio distribution.

Returns

  • q::Float64: Randomly sampled planet star mass ratio.

Description

Randomly sampled planet star mass ratio.

source
demographics.set_filtersMethod
set_filters(parameters::Dict) -> filters

Arguments

  • parameters::Dict: A dictionary of filter parameters.

Returns

  • filters::Vector{Dict}: A vector of filter dictionaries suitable for MAST API requests.

Description

Convert a dictionary of filter parameters into a vector of filter dictionaries for MAST API requests.

source
demographics.set_min_maxMethod
set_min_max(min, max) -> filter

Arguments

  • min: Minimum value for the filter.
  • max: Maximum value for the filter.

Returns

  • filter::Vector{Dict}: A vector containing a single dictionary with "min" and "max" keys.

Description

Create a filter dictionary with specified minimum and maximum values for MAST API requests.

source
demographics.transit_SNRMethod
transit_SNR(Rₚ,Rₛ,CDPP,T_dur,δ,Cont) -> SNR

Arguments

  • Rₚ::Float64: Radius of the planet.
  • Rₛ::Float64: Radius of the star.
  • CDPP::Float64: Combined Differential Photometric Precision of the star.
  • T_dur::Float64: Duration of the transit in hours.
  • δ::Float64: Transit depth.
  • Cont::Float64: Star's contamination ratio from CTL.

Returns

  • SNR::Float64: Signal-to-noise ratio of the transit.

Description

Calculate the signal-to-noise ratio (SNR) of a transit given the planet and star parameters.

source
demographics.transit_durationMethod
transit_duration(a, Rₛ, Rₚ, e, ω, cosi, P) -> T_dur

Arguments

  • a::Float64: Semi-major axis of the planet's orbit.
  • Rₛ::Float64: Radius of the star.
  • Rₚ::Float64: Radius of the planet.
  • e::Float64: Orbital eccentricity.
  • ω::Float64: Periastron angle.
  • cosi::Float64: Cosine of the inclination angle.
  • P::Float64: Orbital period of the planet.
  • b::Float64: Impact parameter of the transit.

Returns

  • T_dur::Float64: Duration of the transit in hour.

Description

Calculate the duration of a transit for a planet given its orbital parameters and the host star's radius

source