kaitiaki.file_handlers.plotfile =============================== .. py:module:: kaitiaki.file_handlers.plotfile Classes ------- .. autoapisummary:: kaitiaki.file_handlers.plotfile.plot Functions --------- .. autoapisummary:: kaitiaki.file_handlers.plotfile.get_last_line kaitiaki.file_handlers.plotfile.plot2 Module Contents --------------- .. py:function:: get_last_line(self, file) .. py:class:: plot(file: str = 'plot', allow_pad_age: bool = True, row: str = 'all', dummy_object: bool = False, DEBUG_load_pandas: bool = False) .. py:attribute:: _DEBUG_load_pandas :value: False .. py:attribute:: _segment_points :value: [] .. py:attribute:: _filename :value: 'plot' .. py:attribute:: _allow_pad_age :value: True .. py:method:: __len__() .. py:method:: last() .. py:method:: zams() .. py:method:: reconstruct(path) .. py:method:: __add__(other) .. py:method:: access() .. py:method:: get(key) .. py:method:: hr_diagram(ax=None, **kwargs) .. py:method:: truncate(truncate_to) .. py:method:: 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) .. py:method:: 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. :param x_axis: The x-axis to plot. Must be a key of self._data :type x_axis: str :param y_axis: The y-axis to plot. Must be a key of self._data :type y_axis: str :param transform: A function to apply to each axis :type transform: callable :param ax: An Axes2D instance to plot on. If None, a new figure is created. :type ax: Axes2D :param fix_core_masses: Whether to fix the core masses such that the He core follows the envelope if the star becomes entirely stripped. :type fix_core_masses: bool :param \*\*kwargs: Any keyword arguments to be passed to plt.plot. :type \*\*kwargs: variable :returns: The list of Line2d objects plotted by plt.plot. :rtype: list .. rubric:: Notes transform should be a function matching the call-signature :code:`transform(axis, array)`, where axis is 'x' or 'y' and array is the corresponding axis to variable :code:`axis`. 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). .. py:method:: pad_age(by) .. py:method:: parse_plotfile(fname: str = 'plot', row: str = 'all', is_dummy: bool = False) Parses a plotfile. :param fname: The plot file to load :type fname: str :param row: The row to load (obsolute -- always pass "all") :type row: str :param is_dummy: Whether the dataframe should be empty or not :type is_dummy: bool :returns: [description] :rtype: [type] .. py:function:: plot2(file: str = 'plot2', *args, **kwargs)