sherlockpipe.system_stability.stability_calculator.StabilityCalculator
- class sherlockpipe.system_stability.stability_calculator.StabilityCalculator(dt=0.05)
Bases:
ABCTemplate class for system stability calculation algorithms
- __init__(dt=0.05)
Methods
__init__([dt])init_rebound_simulation(simulation_input)Initializes the simulation for rebound-based algorithms
log_and_run_simulation(simulation_input)Logs the simulation input and launches the simulation for the given input.
mass_from_radius(radius)Computation of mass-radius relationship from Bashi D., Helled R., Zucker S., Mordasini C., 2017, A&A, 604, A83.
plot_simulation(simulation_input_df, ...[, ...])prepare_planet_params(planet_params)Fills the planet masses if missing
prepare_star_masses(star_mass_low, ...)Creates a star masses grid
run(results_dir, star_mass_low, ...[, cpus, ...])Creates possible scenarios of stellar masses, planet masses and planet eccentricities.
run_simulation(simulation_input)Runs one stability scenario
store_simulation_results(simulation_results, ...)Writes into disk all the final simulation results
- init_rebound_simulation(simulation_input)
Initializes the simulation for rebound-based algorithms
- Parameters:
simulation_input – the input data for the simulation scenario
- Returns:
the rebound initialized simulation scenario
- log_and_run_simulation(simulation_input: SimulationInput) dict
Logs the simulation input and launches the simulation for the given input.
- Parameters:
simulation_input (SimulationInput)
- Return dict:
the resulting dictionary from the simulation
- static mass_from_radius(radius)
Computation of mass-radius relationship from Bashi D., Helled R., Zucker S., Mordasini C., 2017, A&A, 604, A83. doi:10.1051/0004-6361/201629922
- Parameters:
radius – the radius value in earth radius
- Returns:
the mass in earth masses
- static prepare_planet_params(planet_params: List[PlanetInput])
Fills the planet masses if missing
- Parameters:
planet_params – the planet inputs
- Returns:
the planet inputs with the filled masses
- static prepare_star_masses(star_mass_low, star_mass_up, star_mass_bins)
Creates a star masses grid
- Parameters:
star_mass_low – the lowest star mass value
star_mass_up – the highest star mass value
star_mass_bins – the number of star masses to sample. It will be ignored if star_mass_low == star_mass_up.
- Returns:
the star masses grid
- run(results_dir, star_mass_low, star_mass_up, star_mass_bins, planet_params: List[PlanetInput], cpus=1, free_params=None)
Creates possible scenarios of stellar masses, planet masses and planet eccentricities. Afterwards a stability analysis is run for each of the scenarios and the results are stored in a file.
- Parameters:
results_dir – the directory where the results will be written into
star_mass_low – the lowest star mass
star_mass_up – the highest star mass
star_mass_bins – the number of star masses to sample
planet_params (List[PlanetInput]) – the planet inputs containing the planets parameters
cpus – the number of cpus to be used
free_params – the parameters to be sampled entirely
- abstractmethod run_simulation(simulation_input: SimulationInput) dict
Runs one stability scenario
- Parameters:
simulation_input (SimulationInput) – the simulation scenario parameters
- Return dict:
the result of the scenario in a dictionary
- abstractmethod store_simulation_results(simulation_results: List[Dict], results_dir: str)
Writes into disk all the final simulation results
- Parameters:
simulation_results (List[Dict]) – the results of the simulation for all the scenarios
results_dir (str) – the output directory where results will be written into