posydon.binary_evol.MESA

posydon.binary_evol.MESA.step_mesa

This class evolves a binary object according to a MESA grid.

class posydon.binary_evol.MESA.step_mesa.CO_HMS_RLO_step(metallicity=1., grid_name=None, *args, **kwargs)[source]

Bases: MesaGridStep

Class for performing the MESA step for a CO-HMS_RLO binary.

Initialize a CO_HMS_RLO_step instance.

class posydon.binary_evol.MESA.step_mesa.CO_HeMS_RLO_step(metallicity=1., grid_name=None, *args, **kwargs)[source]

Bases: MesaGridStep

Class for performing the MESA step for a CO-HeMS_RLO binary.

Initialize a CO_HeMS_RLO_step instance.

class posydon.binary_evol.MESA.step_mesa.CO_HeMS_step(metallicity=1., grid_name=None, *args, **kwargs)[source]

Bases: MesaGridStep

Class for performing the MESA step for a CO-HeMS binary.

Initialize a CO_HeMS_step instance.

class posydon.binary_evol.MESA.step_mesa.MS_MS_step(metallicity=1., grid_name=None, *args, **kwargs)[source]

Bases: MesaGridStep

Class for performing the MESA step for a MS-MS binary.

Initialize a MS_MS_step instance.

class posydon.binary_evol.MESA.step_mesa.MesaGridStep(metallicity, grid_name, path=PATH_TO_POSYDON_DATA, interpolation_path=None, interpolation_filename=None, interpolation_method='linear3c_kNN', save_initial_conditions=True, track_interpolation=False, stop_method='stop_at_max_time', stop_star='star_1', stop_var_name=None, stop_value=None, stop_interpolate=True, verbose=False)[source]

Bases: object

Superclass for steps using the POSYDON grids.

Evolve a binary object given a MESA grid or interpolation object.

Parameters:
  • interpolation_method ('nearest_neighbour', 'linear_knn_interpolation') –

    ‘linear_NN_interpolation’ - nearest_neighbour requires a psygrid in the h5 format - linear_knn_interpolation requires a pkl file trained with

    interpolation class linear inteprolation, knn classification

    • linear_NN_interpolation requires a pkl file trained with

      interpolation class linear inteprolation, neural network classification

  • track_interpolation (bool) –

    • True requires nearest_neighbour and will append the entire MESA history of properties.

  • stop_method (stop_at_end or stop_at_max_time) –

    • stop_at_end will stop the binary at the end of the MESA track

    • stop_at_max_time binary will stop in the middle of a MESA track if doing so would exceed the binary’s max_time

    • stop_at_condition will stop the binary when a five condition is met (see next parameters)

  • stop_var_name (keys in STARPROPERTIES and) – BINARYPROPERTIES - key is one of the STARPROPERTIES and BINARYPROPERTIES

  • stop_star (star_1 or star_2) –

    • if you choose stop_var_name from STARPROPERTIES you need to indicate which star you are referring too

  • stop_value (float) –

    • when value is reached in the next MESA history model, the binary will stop the evolution

  • stop_interpolate (True or False) –

    • True can only be chosen if stop_var_name=’time’, it means that the binary properties will be linearly interpolated between two timestamp to determine their values at the arbitrary time stop_value

close()[source]

Close the inteprolator.

get_final_MESA_step_time()[source]

Infer the maximum MESA step time.

Use the specified interpolation method to determine the maximum MESA simulation time about to be added to the binary. If this step exceeds the maximum age of the binary, a step(NN) is done.

initial_final_interpolation(star_1_CO=False, star_2_CO=False)[source]

Update the binary through initial-final interpolation.

interpolate_at_t(t, t_before, t_after, v_before, v_after)[source]

Linear interpolation in time between two points.

Parameters:
  • t (type) – Description of parameter t.

  • t_before (type) – Description of parameter t_before.

  • t_after (type) – Description of parameter t_after.

  • v_before (type) – Description of parameter v_before.

  • v_after (type) – Description of parameter v_after.

Returns:

Description of returned object.

Return type:

type

load_Interp(filename)[source]

Load the interpolator that has been trained on the grid.

load_psyTrackInterp(grid_name)[source]

Load the interpolator that has been trained on the grid.

single_star(star_type)[source]

Check if the type of the star is supported.

step(binary, interp_method=None)[source]

Take the step by calling the appropriate interpolator.

stop_at_condition(binary, property='time', value=None, star='star_1', interpolate=False, star_1_CO=False, star_2_CO=False)[source]
stop_at_end(binary, property=None, value=None, star=None, interpolate=None, star_1_CO=False, star_2_CO=False)[source]

Update the binary event if max time has been exceeded.

update_properties_NN(star_1_CO=False, star_2_CO=False, track_interpolation=False)[source]

Update properites according to nearest neighbour interpolation.

Parameters:
  • star_1_CO (bool) – True if star_1 is a compact object.

  • star_2_CO (bool) – True if star_2 is a compact object.

  • track_interpolation (bool) – If True, uses track interpolation over initial-final interpolation