src.superphot_plus.elasticc_class

Module Contents

Classes

ElasticcClass

Classes of Supernovae

class ElasticcClass[source]

Bases: superphot_plus.supernova_class.SupernovaClass

Classes of Supernovae

SUPERNOVA_IA = 'SN Ia'[source]
SUPERNOVA_IBC = 'SN Ibc'[source]
SUPERNOVA_II = 'SN II'[source]
SUPERNOVA_IIN = 'SN IIn'[source]
SUPERLUMINOUS_SUPERNOVA_I = 'SLSN-I'[source]
classmethod get_type_maps(allowed_types=None)[source]

For some allowed supernova classes, create dictionaries mapping an integer classification to the type string.

Parameters:
  • cls (SupernovaClass) – The SupernovaClass class.

  • allowed_types (list of str, optional) – The list of supernova classes to be included in the mapping. Defaults to [“SN Ia”, “SN II”, “SN IIn”, “SLSN-I”, “SN Ibc”].

Returns:

Tuple containing the mapping of string labels to integer identifiers and the mapping of integer identifiers to string labels, respectively.

Return type:

tuple of dict

classmethod get_alternative_namings()[source]

Returns the alternative namings for each supernova class.

Parameters:

cls (SupernovaClass) – The SupernovaClass class.

Returns:

A dictionary that maps each supernova class label to its respective alternative namings.

Return type:

dict

classmethod canonicalize(label)[source]

Returns a canonical label, using the proper and alternative namings for each supernova class.

Parameters:
  • cls (SupernovaClass) – The SupernovaClass class.

  • label (str) – The label to canonicalize

Returns:

original label if already canonical, supernova class string if found in dictionary of alternative names, or the original label if not able to be canonicalized.

Return type:

str