kaitiaki.classifier =================== .. py:module:: kaitiaki.classifier Functions --------- .. autoapisummary:: kaitiaki.classifier.compute_separation kaitiaki.classifier.diagnosis_plot kaitiaki.classifier.go kaitiaki.classifier.to_str kaitiaki.classifier.strings kaitiaki.classifier.explain_result kaitiaki.classifier.dual_explain Module Contents --------------- .. py:function:: compute_separation(P, M, m) Computes the separation of a BSS Uses Kepler's third law to compute the separation, in days. Decorators: np.vectorize :param P {float} -- The period of the binary star: :type P {float} -- The period of the binary star: in days :param M {float} -- The mass of the primary star: :type M {float} -- The mass of the primary star: in solar masses :param m {float} -- The mass of the secondary star: :type m {float} -- The mass of the secondary star: in solar masses :returns: {float} -- The orbital separation in Solar Radii .. py:function:: diagnosis_plot(files_loc: str = '.', time_axis: str = 'age', fname: str | None = None, fext: str = '', temp=None, lum=None) Generates a diagnosis plot for a model. This is a 3x3 plot, with the following axes (left to right, top to bottom): - Mass - Kippenhahn Diagram (Star 1) - log(L) - Radius - HR Diagram - log(T) - Helium Luminosity - Kippenhahn Diagram (Star 2) OR Chemical Composition Plot (Star 1) - Mass Loss Rate The secondary, if it exists, is shown in dashed lines. If the secondary does not exist, the Kippenhahn for Star 2 will instead be the Chemical Composition Plot for Star 1. :param files_loc: the location of the files to load (default: `'.'`) :type files_loc: str :param time_axis: whether the x-axis should be age or timestep (default: `'age'`) :type time_axis: str :param fname: The filename to save the figure as. If None, no figure is saved. (default: `None`) :type fname: str :param fext: The file extension of the files to be plotted, with no leading period (e.g. 'bak' for 'plot.bak'). If an empty string is passed, it is assumed the files have no extension. (default: '') :type fext: str .. py:function:: go(outfile_loc: str = 'out', plotfile_loc: str = 'plot', as_string: bool = False, explain: bool = False, detailed_return: bool = False, has_he_flash: bool = False) Classifies a model according to the modelcheck criteria used by Jan. Performs a rudimentary classification based on manually inspected values. It is my wish to replace this one day with a CNN. :param outfile_loc: The outfile to load. (default: `'out'`) :type outfile_loc: str :param plotfile_loc: The plotfile to load (default: `'plot'`) :type plotfile_loc: str :param as_string: Whether to return the result as a string like 'Too Old' or the numeric code like 8.0 (default: `False`) :type as_string: bool :param explain: Whether to use kaitiaki's debugger to print out an explanation as to how the result was obtained. (default: `False`) :type explain: bool :param detailed_return: If True, instead of returning anything else, this will return all the arguments that can be passed to :code:`explain`. Note that this is a more complicated way of going explain=True, and is only really useful to the :code:`dual_explain()` function. (default: `False`) :type detailed_return: bool :param has_he_flash: Whether or not the model has a helium flash you want it to consider. (default: `False`) :type has_he_flash: bool :returns: If :code:`detailed_return` is True, a 3-tuple containing the arguments to :code:`explain()`. Else, if :code:`as_string` is True, the string representing the classification (e.g. "SNe" or "White Dwarf"). Else, the numeric code representing the result -- the whole part being the type (e.g. 1 is SNe) and the decimal part being the confidence, where a LOWER confidence is better. e.g. 1.1 means SNe with a better confidence than 1.3. :rtype: mixed .. py:function:: to_str(code) .. py:function:: strings() .. py:function:: explain_result(explainer, plausible_outcomes, outcome, speak=True) .. py:function:: dual_explain(obj1, obj2)