kaitiaki.classifier

Functions

compute_separation(P, M, m)

Computes the separation of a BSS

diagnosis_plot([files_loc, time_axis, fname, fext, ...])

Generates a diagnosis plot for a model.

go([outfile_loc, plotfile_loc, as_string, explain, ...])

Classifies a model according to the modelcheck criteria used by Jan.

to_str(code)

strings()

explain_result(explainer, plausible_outcomes, outcome)

dual_explain(obj1, obj2)

Module Contents

kaitiaki.classifier.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

Parameters:
  • star (m {float} -- The mass of the secondary)

  • star

  • star

Returns:

{float} – The orbital separation in Solar Radii

kaitiaki.classifier.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.

Parameters:
  • files_loc (str) – the location of the files to load (default: ‘.’)

  • time_axis (str) – whether the x-axis should be age or timestep (default: ‘age’)

  • fname (str) – The filename to save the figure as. If None, no figure is saved. (default: None)

  • fext (str) – 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: ‘’)

kaitiaki.classifier.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.

Parameters:
  • outfile_loc (str) – The outfile to load. (default: ‘out’)

  • plotfile_loc (str) – The plotfile to load (default: ‘plot’)

  • as_string (bool) – Whether to return the result as a string like ‘Too Old’ or the numeric code like 8.0 (default: False)

  • explain (bool) – Whether to use kaitiaki’s debugger to print out an explanation as to how the result was obtained. (default: False)

  • detailed_return (bool) – If True, instead of returning anything else, this will return all the arguments that can be passed to explain. Note that this is a more complicated way of going explain=True, and is only really useful to the dual_explain() function. (default: False)

  • has_he_flash (bool) – Whether or not the model has a helium flash you want it to consider. (default: False)

Returns:

If detailed_return is True, a 3-tuple containing the arguments to explain(). Else, if 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.

Return type:

mixed

kaitiaki.classifier.to_str(code)
kaitiaki.classifier.strings()
kaitiaki.classifier.explain_result(explainer, plausible_outcomes, outcome, speak=True)
kaitiaki.classifier.dual_explain(obj1, obj2)