Data visualization in VH diagram.
- class posydon.visualization.VH_diagram.Presenter.Presenter(filename, path='./', binary=False)[source]
Bases:
object
Charged to setup window and format data before calling display funcs.
Initialize a Presenter instance.
- PATH_TO_DRAWS = '/Users/max/Documents/POSYDON/posydon/visualization/VH_diagram/draws'
- PATH_TO_SCREENS = '/Users/max/Documents/POSYDON_versions/POSYDON_v1.0.4/docs/screens'
- class posydon.visualization.VH_diagram.Presenter.SimplifiedInfo(state_before=None, state_after=None)[source]
Bases:
object
Simple class to store an before/after info and simplfy dataframe.
- Parameters
state_before (any value) – Value for the older state.
state_after (any value) – Value for the younger state.
- state_before
- state_after
Initialize a SimplifiedInfo instance.
- posydon.visualization.VH_diagram.Presenter.calculate_separation(data)[source]
For each row in dataframe, calculate the separation.
- Parameters
data (pandas.DataFrame) – Complete dataframe without ‘separation’.
- Returns
Array of calculated separations, len(array) == nb rows.
- Return type
Array of float
- posydon.visualization.VH_diagram.Presenter.combine_simplified_data(*, data_to, data_from)[source]
Combine 2 dictionaries of SimplifiedInfo.
data_to[].state_after take the value of data_from[].state_before.
- Parameters
data_to (dictionary of SimplifiedInfo) – Informations who will be udpated.
data_from (dictionary of SimplifiedInfo) – Informations who will be combined.
- posydon.visualization.VH_diagram.Presenter.equal_with_epsilon(nb_1, nb_2, epsilon)[source]
Check if 2 numbers are equal up to epsilon.
- posydon.visualization.VH_diagram.Presenter.get_event_state_filename(left_star_state, event_state, right_star_state, *, suffix='')[source]
Get the name of the file illustrating the event with the 2 given star.
- posydon.visualization.VH_diagram.Presenter.get_max_distance(data)[source]
Get max distance from a dictionary of SimplifiedInfo.
- Parameters
data (dictionnary of SimplifiedInfo) – Dictionnary, full of SimplifiedInfo, containing all infos
- Returns
Max distance of this row, accroding to before/after state
- Return type
- posydon.visualization.VH_diagram.Presenter.get_star_state_filename(state, *, suffix='')[source]
Get the name of the file illustring the state of one star.
- posydon.visualization.VH_diagram.Presenter.to_simplified_data(row)[source]
Convert dictionnary of SimplifiedInfo with values as .state_before.
- Parameters
row (dictionnary) – Dictionnary of value to convert.
- Returns
Dictionnary of SimplifiedInfo containing the value as SimplifiedInfo.state_before.
- Return type
dictionnary of SimplifiedInfo