XraySpectrum1D

The basic functionality to load and visualize X-ray spectra is provided with the XraySpectrum1D class.

To initialize XraySpectrum1D, you must input the counts histogram data directly.

class pyxsis.xrayspectrum1d.XraySpectrum1D(bin_lo, bin_hi, counts, exposure, arf=None, rmf=None, **kwargs)[source]

Spectrum properties specific to X-ray data

Attributes

Inherits from specutils Spectrum1D object. The following inputs are stored as additional attributes.

bin_loastropy.Quantity

The left edges for bin values

bin_hiastropy.Quantity

The right edges for bin values

countsastropy.Quantity

Counts histogram for the X-ray spectrum

exposureastropy.Quantity

Exposure time for the dataset

arfARF object

Telescope response file describing the effective area as a function of photon energy.

rmfRMF object

Telescope response file, a 2D matrix, describing the detector signal (pulse heights) distribution as a function photon energy.

rest_valueastropy.units.Quantity, default 0 Angstrom

See Spectrum1D rest_value input

apply_response(mflux, exposure=None)[source]

Given a model flux spectrum, apply the response. In cases where the spectrum has both an auxiliary response file (ARF) and a redistribution matrix file (RMF), apply both. Otherwise, apply whatever response is in RMF.

The model flux spectrum must be created using the same units and bins as in the ARF (where the ARF exists)!

Inputs

mfluxastropy.units.Quantity

A list or array with the model flux values, typically with units of phot/s/cm^-2

exposureastropy.units.Quantity (default: None)

By default, the exposure stored in the ARF will be used to compute the total counts per bin over the effective observation time. In cases where this might be incorrect (e.g. for simulated spectra where the pha file might have a different exposure value than the ARF), this keyword provides the functionality to override the default behaviour and manually set the exposure time to use.

Returns

model_countsnumpy.ndarray

The model spectrum in units of counts/bin

If no ARF file exists, it will return the model flux after applying the RMF If no RMF file exists, it will return the model flux after applying the ARF (with a warning) If no ARF and no RMF, it will return the model flux spectrum (with a warning)

assign_arf(arf_inp, **kwargs)[source]

Assign an auxiliary response file (ARF) object to the XraySpectrum1D object

Inputs

arf_inpstring

File name for the area response file (FITS file)

Returns

Modifies the XraySpectrum1D.arf attribute

assign_rmf(rmf_inp)[source]

Assign a redistribution matrix file (RMF) object to the XraySpectrum1D object

Input

rmf_inpstring

File name for the response matrix file (FITS file)

Returns

Modifies the XraySpectrum1D.rmf attribute