The star object describe the star current and past state.

The star object contains the current and past states of the star. Only parameters in the STARPROPERTIES list are stored in the history. The current parameter value of the star object is accessed as, e.g. star.mass, while his past history with star.mass_history.

class posydon.binary_evol.singlestar.SingleStar(**kwargs)[source]

Bases: object

Class describing a single star.

Initialize the star.

Parameters

**kwargs (dict) – List of initialization parameters for a star.

append_state()[source]

Append the new version of the star to the end of the star state.

static from_run(run, history=False, profile=False, which_star=None)[source]

Create a SingleStar object from a single-star grid run.

restore(i=0, delete_history=True)[source]

Restore the object to the i-th state.

Parameters

i (int) – Index of the star object history to reset the star to. By default i == 0, i.e. the star will be restored to its initial state.

to_df(**kwargs)[source]

Return history parameters from the star in a DataFrame.

By default all parameters in STARPROPERTIES are included.

Parameters
  • extra_columns (list) – Extra star history parameters to return in DataFrame that are not included in STARPROPERTIES. Can be used in combination with only_select_columns. Assumes names have no suffix.

  • ignore_columns (list) – Names of STARPROPERTIES parameters to ignore. Assumes names have _history suffix.

  • only_select_columns (list) – Names of the only columns to include. Can be used in combination with extra_columns. Assumes names have _history suffix.

  • include_profile (bool) – Include the star’s profile in the dataframe (NOT RECOMMENDED)

  • null_value (float, optional) – Replace all None values with something else (for saving). Default is np.NAN.

  • prefix (str, optional) – Prefix to all column names. (e.g. ‘star_1’, ‘S1’) Default has no prefix.

Returns

Return type

pandas DataFrame

to_oneline_df(history=True, prefix='', **kwargs)[source]

Convert SingleStar into a single row DataFrame.

By default, initial final values of history are used with the to_df method. Any scalar values can also be added.

Parameters
  • scalar_names (list of str) – Names of any values to be added to the oneline DataFrame.

  • history (bool) – Include the history initial-final values from to_df method.

  • prefix (str) – Any prefix to go at the beginning of all columns names.

  • **kwargs – All options for the to_df method.

Returns

Return type

oneline_df