padre_meddea.spectrum.spectrum#

Provides data containers for both summary spectra and event list or photon data.

Classes

PhotonList(pkt_list, event_list)

Data container for MeDDEA photon or event list data

SpectrumList(pkt_list, specs, pixel_ids)

A data container for MeDDEA summary spectrum data

class padre_meddea.spectrum.spectrum.PhotonList(pkt_list: TimeSeries, event_list: TimeSeries)[source]#

Data container for MeDDEA photon or event list data

Parameters:
  • pkt_list (TimeSeries) – The time series of photon packet header data.

  • event_list (TimeSeries) – The time series of event data

Examples

>>> from padre_meddea.io import read_file
>>> from padre_meddea.util.pixels import PixelList
>>> ph_list = read_file("padre_meddea_l0test_photons_20250504T070411_v0.1.0.fits")
>>> this_spectrum = ph_list.spectrum(pixel_list=ph_list.pixel_list)
_slice_event_list_pixels(pixel_list: PixelList) TimeSeries[source]#

Slice the event list to only contain events from asic_num and pixel_num

_slice_event_list_sr(sr: SpectralRegion)[source]#

Slice the envt list to only contain events inside the spectral region.

_text_summary()[source]#
property calibrated#
data_rate() BinnedTimeSeries[source]#

Return a BinnedTimeseries of the data rate.

Returns:

data_rate (BinnedTimeSeries)

lightcurve(pixel_list: PixelList, int_time: Annotated[Quantity, Unit('s')], sr: SpectralRegion, step: int = 10) TimeSeries[source]#

Create a light curve

Parameters:
  • pixel_list (PixelList) – The pixels to integrate over

  • int_time (u.Quantity[u.s]) – The integration time for each time step

  • sr (SpectralRegion) – The spectral region(s) to integrate over

  • step (int) – To speed up processing, skip every step photons. Default is ten. The light curve count rate is corrected by multiplying by step.

Returns:

lc (TimeSeries)

property pixel_list: PixelList#

Return the set of pixels that have events

spectrum(pixel_list: PixelList, bins=None, baseline_sub: bool = False, calibrate: bool = False) Spectrum1D[source]#

Create a spectrum

Parameters:
  • pixel_list (PixelList) – A list of one or more pixels

  • bins (np.array) – The bin edges for the spectrum (see ~np.histogram). If None, then uses np.arange(0, 2**12 - 1)

  • baseline_sub (bool) – If True, then baseline measurements are subtracted if they exist Note: not yet implemented.

  • calibrate (bool) – If True, provide the calibrated spectrum

Returns:

spectrum (Spectrum1D)

class padre_meddea.spectrum.spectrum.SpectrumList(pkt_list: TimeSeries, specs, pixel_ids)[source]#

A data container for MeDDEA summary spectrum data

Parameters:
  • pkt_spec (TimeSeries) – The time series of spectrum packet header data.

  • specs (Spectrum1D) – The spectrum cube

  • pixel_ids (np.array) – The pixel id array

Raises:

ValueError – If pixel arrays are found to change.

Examples

>>> from padre_meddea.io import read_file
>>> from astropy.time import Time
>>> spec_list = read_file("padre_meddea_l0test_spectrum_20250504T070411_v0.1.0.fits")
>>> this_spectrum = spec_list.spectrum(pixel_list=spec_list.pixel_list)
_text_summary()[source]#
property calibrated#
lightcurve(pixel_list: PixelList, sr: SpectralRegion) TimeSeries[source]#

Create a light curve

Parameters:
  • pixel_index (int) – The pixels to integrate over

  • sr (SpectralRegion) – The spectral region(s) to integrate over

Returns:

lc (TimeSeries)

plot_spectrogram(**imshow_kwargs)[source]#

Plot a spectrogram

spectrogram()[source]#
spectrum(pixel_list: PixelList)[source]#

Create a spectrum, integrates over all times

Parameters:
  • asic_num (int) – The asic or detector number (0 to 3)

  • pixel_num (int) – The pixel number (0 to 11)

  • or

  • spec_index (int) – The spectrum index from 0 to 23

Raises:

ValueError – If the selected asic_num and pixel_num are not found in the spectra

Returns:

spectrum (Spectrum1D)