pyspi.utils.response.spi_response_data module

class pyspi.utils.response.spi_response_data.ResponseData(energies_database: numpy.array, irf_xmin: float, irf_ymin: float, irf_xbin: float, irf_ybin: float, irf_nx: int, irf_ny: int, n_dets: int, ebounds_rmf_2_base: numpy.array, rmf_2_base: numpy.array, ebounds_rmf_3_base: numpy.array, rmf_3_base: numpy.array)[source]

Bases: object

Base Dataclass to hold the IRF data

__init__(energies_database: numpy.array, irf_xmin: float, irf_ymin: float, irf_xbin: float, irf_ybin: float, irf_nx: int, irf_ny: int, n_dets: int, ebounds_rmf_2_base: numpy.array, rmf_2_base: numpy.array, ebounds_rmf_3_base: numpy.array, rmf_3_base: numpy.array) None
ebounds_rmf_2_base: numpy.array
ebounds_rmf_3_base: numpy.array
energies_database: numpy.array
get_data(version)[source]

Read in the data we need from the irf hdf5 file

Parameters

version – Version of irf file

Returns

all the infomation we need as a list

irf_nx: int
irf_ny: int
irf_xbin: float
irf_xmin: float
irf_ybin: float
irf_ymin: float
n_dets: int
rmf_2_base: numpy.array
rmf_3_base: numpy.array
class pyspi.utils.response.spi_response_data.ResponseDataPhotopeak(energies_database: numpy.array, irf_xmin: float, irf_ymin: float, irf_xbin: float, irf_ybin: float, irf_nx: int, irf_ny: int, n_dets: int, ebounds_rmf_2_base: numpy.array, rmf_2_base: numpy.array, ebounds_rmf_3_base: numpy.array, rmf_3_base: numpy.array, irfs_photopeak: numpy.array)[source]

Bases: pyspi.utils.response.spi_response_data.ResponseData

Dataclass to hold the IRF data if we only need the photopeak irf

__init__(energies_database: numpy.array, irf_xmin: float, irf_ymin: float, irf_xbin: float, irf_ybin: float, irf_nx: int, irf_ny: int, n_dets: int, ebounds_rmf_2_base: numpy.array, rmf_2_base: numpy.array, ebounds_rmf_3_base: numpy.array, rmf_3_base: numpy.array, irfs_photopeak: numpy.array) None
classmethod from_version(version)[source]

Construct the dataclass object

Parameters

version – Which IRF version?

Returns

ResponseDataPhotopeak object

irfs_photopeak: numpy.array
class pyspi.utils.response.spi_response_data.ResponseDataRMF(energies_database: numpy.array, irf_xmin: float, irf_ymin: float, irf_xbin: float, irf_ybin: float, irf_nx: int, irf_ny: int, n_dets: int, ebounds_rmf_2_base: numpy.array, rmf_2_base: numpy.array, ebounds_rmf_3_base: numpy.array, rmf_3_base: numpy.array, irfs_photopeak: numpy.array, irfs_nonphoto_1: numpy.array, irfs_nonphoto_2: numpy.array)[source]

Bases: pyspi.utils.response.spi_response_data.ResponseData

Dataclass to hold the IRF data if we only need all three irfs

__init__(energies_database: numpy.array, irf_xmin: float, irf_ymin: float, irf_xbin: float, irf_ybin: float, irf_nx: int, irf_ny: int, n_dets: int, ebounds_rmf_2_base: numpy.array, rmf_2_base: numpy.array, ebounds_rmf_3_base: numpy.array, rmf_3_base: numpy.array, irfs_photopeak: numpy.array, irfs_nonphoto_1: numpy.array, irfs_nonphoto_2: numpy.array) None
classmethod from_version(version)[source]

Construct the dataclass object

Parameters

version – Which IRF version?

Returns

ResponseDataPhotopeak object

irfs_nonphoto_1: numpy.array
irfs_nonphoto_2: numpy.array
irfs_photopeak: numpy.array
pyspi.utils.response.spi_response_data.load_rmf_non_ph_1()[source]

Load the RMF for the non-photopeak events that first interact in the det

Returns

ebounds of RMF and rmf matrix for the non-photopeak events that first interact in the det

pyspi.utils.response.spi_response_data.load_rmf_non_ph_2()[source]

Load the RMF for the non-photopeak events that first interact in the dead material

Returns

ebounds of RMF and rmf matrix for the non-photopeak events that first interact in the dead material