6.3.5. Plot functions¶
6.3.5.1. Model spectrum plots¶
- class pyspex.plot.PlotModel[source]¶
Class containing the model spectra for plotting purposes.
- Variables:
nsector (int) – Number of sectors available.
sector (list of objects) – List of plot objects for each sector.
- adum_xspec_qdp(isect, qdpfile, overwrite=False)[source]¶
Write the model to a QDP file in Xspec output format. This is useful to use SPEX models as input for various simulation programs, like SIMX, SIXTE and HEASIM.
- plot(xlog=False, ylog=False, wave=False, title='SPEX Model Spectrum', show=True)[source]¶
Plot the model spectrum for all sectors.
- Parameters:
xlog (bool) – (Optional) Set the X-axis to be logarithmic.
ylog (bool) – (Optional) Set the Y-axis to be logarithmic.
wave (bool) – (Optional) Plot in wavelength (Angstrom)
title (str) – (Optional) Set the title of the plot.
show (bool) – (Optional) Show the plot (True) or return the plot object (False).
- Returns:
Matplotlib plt object.
- Return type:
matplotlib.pyplot
- class pyspex.plot.PlotModelSector[source]¶
Class containing the spectral model for a particular sector for plotting purposes.
- Variables:
xc (astropy.units.quantity.Quantity) – Central bin energy (keV).
xb (astropy.units.quantity.Quantity) – Upper boundary of bin energy (keV).
m (astropy.units.quantity.Quantity) – Model spectrum (Photons/m**2/s/keV).
n (int) – Number of bins.
tabmodel (astropy.table.table.QTable) – Astropy QTable containing the model spectrum
6.3.5.2. Data plots¶
- class pyspex.plot.PlotData[source]¶
Class containing the observed spectrum and the convolved model spectrum for plotting.
- Variables:
- chiplot(xlog=False, ylog=False, chi='dchi', wave=False, title='SPEX', show=True)[source]¶
Plot the observed data, model and background spectra for all instruments, and include a subwindow with the residuals. Chi options are ‘dchi’: (observed - model)/error and ‘rel’: (observed - model)/model.
- Parameters:
xlog (bool) – (Optional) Set the X-axis to be logarithmic.
ylog (bool) – (Optional) Set the Y-axis to be logarithmic.
chi (str) – (Optional) Type of residual. Either ‘dchi’ (data-model)/error or ‘rel’ (data-model)/model.
wave (bool) – (Optional) Plot residuals as a function of wavelength (Angstrom)
title (str) – (Optional) Set the title of the plot.
show (bool) – (Optional) Show the plot (True) or return the plot object (False).
- Returns:
Matplotlib plt object.
- Return type:
matplotlib.pyplot
- plot(xlog=False, ylog=False, wave=False, title='SPEX', show=True)[source]¶
Plot the observed data, model and background spectra for all instruments.
- Parameters:
xlog (bool) – (Optional) Set the X-axis to be logarithmic.
ylog (bool) – (Optional) Set the Y-axis to be logarithmic.
wave (bool) – (Optional) Plot the data on a wavelength scale (Angstrom).
title (str) – (Optional) Set the title of the plot.
show (bool) – (Optional) Show the plot (True) or return the plot object (False).
- Returns:
Matplotlib plt object.
- Return type:
matplotlib.pyplot
- plot_chi(ax)[source]¶
Generate plot data for a plot of the residuals.
- Parameters:
ax (matplotlib.axes.Axes) – Axis object from Matplotlib.
- plot_comp(xlog=False, ylog=False, wave=False, title='SPEX', show=True)[source]¶
Plot the total spectrum and the individual additive model components.
- Parameters:
xlog (bool) – (Optional) Set the X-axis to be logarithmic.
ylog (bool) – (Optional) Set the Y-axis to be logarithmic.
wave (bool) – (Optional) Plot as function of wavelenght (Angstrom).
title (str) – (Optional) Set the title of the plot.
show (bool) – (Optional) Show the plot (True) or return the plot object (False).
- Returns:
Matplotlib plt object.
- Return type:
matplotlib.pyplot
- class pyspex.plot.PlotDataInst[source]¶
Class containing the data plot information for this instrument.
- class pyspex.plot.PlotDataReg[source]¶
Class containing the data plot information for a region.
- Variables:
n (int) – Number of bins
elow (astropy.units.quantity.Quantity) – Bin lower boundary (keV)
ectr (astropy.units.quantity.Quantity) – Bin center value (keV)
eupp (astropy.units.quantity.Quantity) – Bin upper boundary (keV)
ewid (astropy.units.quantity.Quantity) – Bin width (keV)
pdata (astropy.units.quantity.Quantity) – Data value (Counts/s/keV)
pmodel (astropy.units.quantity.Quantity) – Model value (Counts/s/keV)
pback (astropy.units.quantity.Quantity) – Background value (Counts/s/keV)
perror (astropy.units.quantity.Quantity) – Error value
tints (astropy.units.quantity.Quantity) – Exposure time (s)
tarea (astropy.units.quantity.Quantity) – Inverse of the effective area value (1/m**2)
comp (list) – List of model components for a component plot
ncomp (int) – Number of model components
tabdata (astropy.table.QTable) – Astropy QTable containing the plot data
chi (numpy.ndarray) – Residual value
chierr (numpy.ndarray) – Residual error
6.3.5.3. Effective area plots¶
- class pyspex.plot.PlotArea[source]¶
Class for plotting effective area.
- Variables:
ninst (int) – Number of instruments.
inst (list of objects) – List of instrument objects.
- plot(xlog=False, ylog=False, wave=False, title='Effective Area', show=True)[source]¶
Plot the effective area.
- Parameters:
xlog (bool) – (Optional) Set the X-axis to be logarithmic.
ylog (bool) – (Optional) Set the Y-axis to be logarithmic.
wave (bool) – (Optional) Plot the effective area as a function of wavelength.
title (str) – (Optional) Set the title of the plot.
show (bool) – (Optional) Show the plot (True) or return the plot object (False).
- Returns:
Matplotlib plt object.
- Return type:
matplotlib.pyplot
- class pyspex.plot.PlotAreaReg[source]¶
Effective area information for each region.
- Variables:
xc (astropy.units.quantity.Quantity) – Energy bin center value (keV)
xb (astropy.units.quantity.Quantity) – Energy bin upper boundary value (keV)
area (astropy.units.quantity.Quantity) – Effective area ()
tabarea (astropy.table.QTable) – Astropy QTable containing the effective area plot