RMFPlot
- class sherpa.astro.plot.RMFPlot[source] [edit on github]
Bases:
HistogramPlotCreate plots of the ancillary response file (RMF).
A full RMF is a matrix that is hard to visualize. Here, we select a few specific energies and show the response function for those energies as histograms.
Changed in version 4.16.1: The plot will now display with the analysis setting of the data argument sent to
prepare. Previously it would always use energies for the X axis. Theenergiessetting can be used to control what energies are chosen for the plot.- Attributes:
- energies
- labels
xReturn (xlo + xhi) / 2
- xhi
- xlo
- y
Methods
hline(y[, xmin, xmax, linecolor, linestyle, ...])Draw a line at constant y, extending over the plot.
plot([overplot, clearwindow])Plot the data.
prepare(rmf[, data])Fill the fields given the RMF.
vline(x[, ymin, ymax, linecolor, linestyle, ...])Draw a line at constant x, extending over the plot.
overplot
Attributes Summary
The energies at which to draw the response (in keV).
The preferences for the plot.
List of strings: The labels for each line.
The number of lines to draw (only used when
energiesisNone).Plot preferences
Title of plot
Return (xlo + xhi) / 2
array_like: The upper edges of each bin.
Label for X axis
array_like: The lower edges of each bin.
array_like: The response for a specific energy or channel.
Label for Y axis
Methods Summary
hline(y[, xmin, xmax, linecolor, linestyle, ...])Draw a line at constant y, extending over the plot.
overplot(*args, **kwargs)plot([overplot, clearwindow])Plot the data.
prepare(rmf[, data])Fill the fields given the RMF.
vline(x[, ymin, ymax, linecolor, linestyle, ...])Draw a line at constant x, extending over the plot.
Attributes Documentation
- energies = None
The energies at which to draw the response (in keV).
If set to None then
n_linesenergies will be selected to span the energy range of the response.
- histo_prefs: dict[str, Any] = {'alpha': None, 'capsize': None, 'color': None, 'ecolor': None, 'label': None, 'linestyle': 'solid', 'linewidth': None, 'marker': 'None', 'markerfacecolor': None, 'markersize': None, 'xerrorbars': False, 'xlog': False, 'yerrorbars': False, 'ylog': False}
The preferences for the plot.
- labels = None
List of strings: The labels for each line.
- rmf_plot_prefs = {'alpha': None, 'capsize': None, 'color': None, 'ecolor': None, 'label': None, 'linestyle': 'solid', 'linewidth': None, 'marker': 'None', 'markerfacecolor': None, 'markersize': None, 'xerrorbars': False, 'xlog': True, 'yerrorbars': False, 'ylog': True}
Plot preferences
- title = ''
Title of plot
- x
Return (xlo + xhi) / 2
This is intended to make it easier to swap between plot- and histogram-style plots by providing access to an X value.
- xhi = None
array_like: The upper edges of each bin.
- xlabel = ''
Label for X axis
- xlo = None
array_like: The lower edges of each bin.
- y = None
array_like: The response for a specific energy or channel.
- ylabel = ''
Label for Y axis
Methods Documentation
- static hline(y, xmin=0, xmax=1, linecolor=None, linestyle=None, linewidth=None, overplot=False, clearwindow=True) [edit on github]
Draw a line at constant y, extending over the plot.
- overplot(*args, **kwargs) [edit on github]
- plot(overplot=False, clearwindow=True, **kwargs)[source] [edit on github]
Plot the data.
This will plot the data sent to the prepare method.
- Parameters:
- overplotbool,
optional If
Truethen add the data to an existing plot, otherwise create a new plot.- clearwindowbool,
optional Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plotcs)?
- **kwargs
These values are passed on to the plot backend, and must match the names of the keys of the object’s plot_prefs dictionary.
- overplotbool,
- prepare(rmf, data=None)[source] [edit on github]
Fill the fields given the RMF.
The
n_linesandenergiesfields can be set to control what lines are shown.Changed in version 4.16.1: The
energiesfield, when set, is used to select the energies to display (if left asNonethenn_linesenergies are chosen automatically).- Parameters:
- RMF
The RMF to plot
- data
DataPHAinstance,optional The
unitsattribute of this object is used to determine whether the X axis should be in Angstrom or channels, instead of KeV (the default).
- static vline(x, ymin=0, ymax=1, linecolor=None, linestyle=None, linewidth=None, overplot=False, clearwindow=True) [edit on github]
Draw a line at constant x, extending over the plot.