Module for computing termination flags of MESA runs.
- There are four flags:
Flag 1: Indicates why the run terminated. Flag 2: Denotes the mass transfer phase(s) the system has gone through. Flag 3: Marks the evolutionary stage of the primary star. Flag 4: Marks the evolutionary stage of the seconary star.
The funtion get_flags_from_MESA_run is responsible for getting all flags for a run, using the more specialized functions defined in the module.
- posydon.grids.termination_flags.check_state_from_history(history, mass, model_index=- 1)[source]
Return the final state of the star from the star history data.
- posydon.grids.termination_flags.get_flag_from_MESA_output(MESA_log_path)[source]
Return a flag about evolutionary outcome based on MESA output file.
- Parameters
MESA_log_path (string) – The output file of MESA.
- Returns
The termination flag inferred from the last line containing the strings min_timestep_limit, or termination code:, or Terminate:.
- Return type
- posydon.grids.termination_flags.get_flags_from_MESA_run(MESA_log_path, binary_history=None, history1=None, history2=None, start_at_RLO=False)[source]
Return the four termination flags.
- Parameters
MESA_log_path (str) – path to the MESA terminal output
binary_history (np.array) – MESA output histories.
history1 (np.array) – MESA output histories.
history2 (np.array) – MESA output histories.
- Returns
flag_MESAout, flag_mass_transfer, final_state_1, final_state_2 – flag_MESAout: actual line of MESA terminal output_path flag_mass_transfer: describes the mass transfer (e.g., case A, case B). final_state_1, final_state_2: describe the final evolutionary
state of the two stars. None if history star is not provided.
- Return type
- posydon.grids.termination_flags.get_mass_transfer_flag(binary_history, history1, history2, start_at_RLO=False, mesa_flag=None)[source]
Read flag from MESA history.
In case of contact during MS, RLOF1, RLOF2 or no_RLOF.
- Parameters
binary_history (np.array) – The binary history file of MESA. Can also be the history of star 1 or 2 if binary history columns.
history1 (np.array) – The history file of MESA for star1.
history2 (np.array) – The history file of MESA for star2.
- Returns
flag_system_evolution_history – Possible flags are: “contact during MS”, “no_RLOF”, a cumulative MT flag + “_from_star1/2”, or in case of missing binary history data, “undetermined_flag_mass_transfer_with_no_binary_history”.
- Return type
string
- posydon.grids.termination_flags.infer_interpolation_class(tf1, tf2)[source]
Use the first two termination flags to infer the interpolation class.