kaitiaki.file_handlers.plotfile
Classes
Functions
|
|
|
Module Contents
- kaitiaki.file_handlers.plotfile.get_last_line(self, file)
- class kaitiaki.file_handlers.plotfile.plot(file: str = 'plot', allow_pad_age: bool = True, row: str = 'all', dummy_object: bool = False, DEBUG_load_pandas: bool = False)
- _DEBUG_load_pandas = False
- _segment_points = []
- _filename = 'plot'
- _allow_pad_age = True
- __len__()
- last()
- zams()
- reconstruct(path)
- __add__(other)
- access()
- get(key)
- hr_diagram(ax=None, **kwargs)
- truncate(truncate_to)
- kippenhahn_diagram(distinguish_envelopes: bool = False, legend: bool = True, x_axis: str = 'modelnum', ax: matplotlib.pyplot.Axes = None, annotate: bool = True, cores_only: bool = False, **kwargs)
- plot(x_axis: str, y_axis: str, transform=None, ax: matplotlib.pyplot.Axes = None, fix_core_masses: bool = True, **kwargs)
Plots the parameter given by x_axis against y_axis.
- Parameters:
x_axis (str) – The x-axis to plot. Must be a key of self._data
y_axis (str) – The y-axis to plot. Must be a key of self._data
transform (callable) – A function to apply to each axis
ax (Axes2D) – An Axes2D instance to plot on. If None, a new figure is created.
fix_core_masses (bool) – Whether to fix the core masses such that the He core follows the envelope if the star becomes entirely stripped.
**kwargs (variable) – Any keyword arguments to be passed to plt.plot.
- Returns:
The list of Line2d objects plotted by plt.plot.
- Return type:
list
Notes
transform should be a function matching the call-signature
transform(axis, array), where axis is ‘x’ or ‘y’ and array is the corresponding axis to variableaxis. The function should return the transformed axis. For instance, the following function:def do_transform(axis, array): if axis == 'y': return np.log10(array) if axis == 'x': return array + 5
shifts the x axis by 5 and logs the y-axis content. The following function:
def do_transform(axis, array): return np.log10(array)
logs both axes, and the following lambda::
do_transform = lambda axis, array: array
does nothing (and is equivalent to passing transform=None).
- pad_age(by)
- parse_plotfile(fname: str = 'plot', row: str = 'all', is_dummy: bool = False)
Parses a plotfile.
- Parameters:
fname (str) – The plot file to load
row (str) – The row to load (obsolute – always pass “all”)
is_dummy (bool) – Whether the dataframe should be empty or not
- Returns:
[description]
- Return type:
[type]
- kaitiaki.file_handlers.plotfile.plot2(file: str = 'plot2', *args, **kwargs)