SpectrumManager (xsnap.SpectrumManager
)#
Methods |
Attributes |
---|---|
- class SpectrumManager(specs=None, tExplosion=None)#
Bases:
object
Manage a collection of
SpectrumFit
objects for batch analysis and plotting.- counts#
Combined count-rate DataFrame.
- Type:
pandas.DataFrame or None
- lumin#
Combined luminosity DataFrame.
- Type:
pandas.DataFrame or None
- params#
Combined parameters DataFrame.
- Type:
pandas.DataFrame or None
- __init__(specs=None, tExplosion=None)#
Initialize of the
SpectrumManager
class- Parameters:
specs (SpectrumFit or array[tuple(SpectrumFit, str)], optional) – Collection of
SpectrumFit
objects, can be parsed singularly or an iterable of (SpectrumFit
, instrument) pairs. Defaults toNone
.tExplosion (float, optional) – Supernova time of explosion in MJD to override or set. Defaults to
None
.
- clear()#
Clear all loaded SpectrumFit objects.
- load(specs, instrument=None)#
Load one or many
SpectrumFit
instances, with optional instrument labels.- Parameters:
specs (SpectrumFit or array[tuple(SpectrumFit, str)], optional) – Collection of
SpectrumFit
objects, can be parsed singularly or an iterable of (SpectrumFit
, instrument) pairs. Defaults toNone
.instrument (str, optional) – Instrument label to use if not provided per-
SpectrumFit
.
- Returns:
- selfSpectrumManager
The same
SpectrumManager
with new specs appended.
- Raises:
TypeError – If
specs
is not aSpectrumFit
or valid iterable.ValueError – If an instrument label cannot be determined.
- plot_counts(scatter=True, log=True)#
Plot count-rate light curves for each model; one trace per instrument.
- Parameters:
- Returns:
- Count rate light curve plotsdict[str, matplotlib.figure.Figure]
Mapping model: str → matplotlib.figure.Figure.
Data are grouped and labeled by instruments.
- plot_flux(scatter=True, log=True)#
Plot flux light curves for each model and kind (‘absorbed’, ‘unabsorbed’).
- Parameters:
- Returns:
- Flux light curve plots: dict[tuple(str, str), matplotlib.figure.Figure]
Mapping (model: str, kind: ‘absorbed’ | ‘unabsorbed’) → matplotlib.figure.Figure.
Data are grouped and labeled by instruments.
- plot_lumin(scatter=True, log=True)#
Plot luminosity light curves for each model.
- Parameters:
- Returns:
- Luminosity light curve plotsdict[str, matplotlib.figure.Figure]
Mapping model: str → matplotlib.figure.Figure.
Data are grouped and labeled by instruments.
- plot_params(scatter=True, log=True)#
Plot fit parameter evolution vs. time for each model and parameter.
- Parameters:
- Returns:
- Parameter evolution plots: dict[tuple(str, str), matplotlib.figure.Figure]
Mapping (model: str, parameter: str) → matplotlib.figure.Figure.
Data are grouped and labeled by instruments.
- plot_phot(scatter=True, log=True)#
Plot photon-flux light curves for each model and kind.
- Parameters:
- Returns:
- Photon flux light curve plots: dict[tuple(str, str), matplotlib.figure.Figure]
Mapping (model: str, kind: ‘absorbed’ | ‘unabsorbed’) → matplotlib.figure.Figure.
Data are grouped and labeled by instruments.