padre_meddea.spectrum.spectrum#
Provides data containers for both summary spectra and event list or photon data.
Classes
|
Data container for MeDDEA photon or event list data |
|
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.
- 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
stepphotons. Default is ten. The light curve count rate is corrected by multiplying bystep.
- Returns:
lc (TimeSeries)
- 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)
- 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)
- spectrum(pixel_list: PixelList)[source]#
Create a spectrum, integrates over all times
- Parameters:
- Raises:
ValueError – If the selected asic_num and pixel_num are not found in the spectra
- Returns:
spectrum (Spectrum1D)