redback.analysis.ClassificationResult

class redback.analysis.ClassificationResult(best_type: str, best_phase: float, best_redshift: float, rlap: float, confidence: str, type_probabilities: dict, top_matches: list, best_template_name: str, best_template_source: str | None = None, method: str = 'rlap', warnings: list | None = None)[source]

Bases: dict

Result of spectral or photometric transient classification.

Behaves as a plain dict (for backward compatibility) while also providing convenience attributes and methods. The dict contains the keys: best_type, best_phase, best_redshift, correlation (= rlap), type_probabilities, top_matches, plus confidence, best_template_name, best_template_source, method, warnings.

Quality interpretation for rlap (spectral matching): - rlap > 8: high confidence match - rlap 5–8: medium confidence - rlap < 5: low confidence, treat with caution

__init__(best_type: str, best_phase: float, best_redshift: float, rlap: float, confidence: str, type_probabilities: dict, top_matches: list, best_template_name: str, best_template_source: str | None = None, method: str = 'rlap', warnings: list | None = None)[source]
__call__(**kwargs)

Call self as a function.

Methods

__init__(best_type, best_phase, ...[, ...])

clear()

copy()

fromkeys(iterable[, value])

Create a new dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

items()

keys()

pop(k[,d])

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

Remove and return a (key, value) pair as a 2-tuple.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

summary()

Return a human-readable classification summary.

to_dict()

Return a plain dict copy (for explicit serialisation).

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()

Attributes

best_phase

best_redshift

best_template_name

best_template_source

best_type

confidence

method

rlap

top_matches

type_probabilities

warnings

clear() None.  Remove all items from D.
copy() a shallow copy of D
classmethod fromkeys(iterable, value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items() a set-like object providing a view on D's items
keys() a set-like object providing a view on D's keys
pop(k[, d]) v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

summary() str[source]

Return a human-readable classification summary.

to_dict() dict[source]

Return a plain dict copy (for explicit serialisation).

update([E, ]**F) None.  Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() an object providing a view on D's values