Plotting class for 1D (MESA) psygrids.

The 2D visualization plotting class allows to plot 1D tracks of PsyGrid objects. The PsyGrid object is composed of nD MESA grid run with POSYDON and post processed with the psygrid object into an h5 file.

class posydon.visualization.plot1D.plot1D(run, x_var_str, y_var_str, z_var_str=None, history='binary_history', star_states=None, HR=False, verbose=False, **kwargs)[source]

Bases: object

Plotting class for 1D (MESA) grids.

Read a PsyGrid object and plot a 1D track of x vs y.

Parameters
  • run (int or list of int) – Index or list of indeces of the PsyGrid object you would like to plot.

  • x_var_str (str) – String of values to plot on the x axis. Allowed strings are the one in psygrid.history.dtype.names where “history” needs to be chosen accordingly.

  • y_var_str (str or list of str) – String or list of stringvalues to plot on the y axis. Allowed strings are the one in psygrid.history.dtype.names where “history” needs to be chosen accordingly.

  • z_var_str (str) – String of values to plot on the z axis (displayed with a color). Allowed strings are the one in psygrid.history.dtype.names where “history” needs to be chosen accordingly.

  • history (str) – The x, y, z variables are read from either: “binary_history”, “history1”, “history2”.

  • HR (bool) – If True, an HR diagram will be plotted.

  • verbose (bool) – If True, the object reports by printing to standard output.

  • **kwargs (dict) – Dictionary containing extra visualisation options (cf. PLOT_PROPERTIES in plot_defaults.py.

HR_diagram()[source]

Plot and HR diagram.

lines_constant_radius()[source]

Constant radius lines for the HR diagram.

plot_panel(ax, i, y_var_str)[source]

Plot the 1D pannel.

Parameters
  • ax (object) – matplotlib figure axes.

  • i (int) – Index of the run to plot.

  • y_var_str (str) – String or list of stringvalues to plot on the y axis.

set_color_bar(scatter)[source]

Add colorbar.

Parameters

scatters (object) – matplotlib scatter object.

set_legend(ax, lines)[source]

Add legend.

Parameters
  • ax (object) – matplotlib figure axes.

  • lines (object) – matplotlib lines object.

set_title(fig)[source]

Add title.

Parameters

fig (object) – matplotlib figure object.

set_xlabel()[source]

Add x label.

set_xlim()[source]

Set x axes limits.

set_ylabel(i)[source]

Add y label.

set_ylim()[source]

Set y axes limits.

update_values_to_plot(y_var_str)[source]

Update all values to plot.

Parameters

y_var_str (str) – String or list of stringvalues to plot on the y axis.