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.
- 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