Synopsis
Plot up the model spectrum in the form required by mkinstmap
Syntax
plot_instmap_weights(id=None, fluxtype="photon", overplot=False, clearwindow=True, **kwargs)
Description
The plot_instmap_weights() command creates a plot of the current model values in the form expected by the CIAO mkinstmap tool. Please see the Calculating Spectral Weights thread for further information on how to use this routine.
Loading the routine
The routine can be loaded into Sherpa by saying:
from sherpa_contrib.utils import *
Arguments
Name | Default value | Description |
---|---|---|
id | None (which means use the value of get_default_id) | Which dataset to use. |
fluxtype | "photon" | The units for the instrument map are cm^2 count / <fluxtype>. The valid options for this argument are "photon" (the default) or "erg". |
overplot | False | If True then the data is added to the current plot, otherwise a new plot is created. |
clearwindow | True | If True then clear out the current plot area of all existing plots. This is not used if overplot is set. |
**kwargs | The plot preferences can be over-ridden (e.g. xlog, ylog, color). |
Examples
Example 1
sherpa> plot_instmap_weights()
Create a plot of the model weights for the default dataset.
Example 2
sherpa> plot_instmap_weights(ylog=True) sherpa> plot_instmap_weights(2, overplot=True, linestyle='dotted')
Plot the weights for datasets 1 and 2, using a log scale for the Y axis and drawing the second curve with a dotted line.
Example 3
sherpa> plot_instmap_weights(fluxtype="erg")
Here the weights are for use in creating an instrument map in units of cm^2 count / erg rather than the default of cm^2 count / photon.
Changes in the scripts 4.12.1 (December 2019) release
The plot styles can be changed using the color settings returned by get_data_plot_prefs (in earlier releases the linecolor and linewidth settings were used, which were used by the ChIPS plotting system).
Changes in the scripts 4.11.4 (2019) release
Plotting can now use matplotlib
The plot_instmap_weights() routine now uses the Sherpa plot backend (controlled by the plot_pkg setting in a user's ~/.sherpa.rc file), rather than always using ChIPS.
Optional argument
The clearwindow optional arguments has been added to plot_instmap_weights.
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- contrib
- estimate_weighted_expmap, get_data_prof, get_data_prof_prefs, get_delchi_prof, get_delchi_prof_prefs, get_fit_prof, get_instmap_weights, get_model_prof, get_model_prof_prefs, get_resid_prof, get_resid_prof_prefs, get_source_prof, get_source_prof_prefs, plot_chart_spectrum, plot_marx_spectrum, prof_data, prof_delchi, prof_fit, prof_fit_delchi, prof_fit_resid, prof_model, prof_resid, prof_source, save_instmap_weights, sherpa_utils
- data
- get_arf_plot, get_bkg_chisqr_plot, get_bkg_delchi_plot, get_bkg_fit_plot, get_bkg_model_plot, get_bkg_plot, get_bkg_ratio_plot, get_bkg_resid_plot, get_bkg_source_plot
- modeling
- normal_sample, t_sample, uniform_sample
- plotting
- get_cdf_plot, get_energy_flux_hist, get_pdf_plot, get_photon_flux_hist, get_pvalue_plot, get_pvalue_results, get_split_plot, plot, plot_arf, plot_bkg, plot_bkg_chisqr, plot_bkg_delchi, plot_bkg_fit, plot_bkg_fit_delchi, plot_bkg_fit_resid, plot_bkg_model, plot_bkg_ratio, plot_bkg_resid, plot_bkg_source, plot_cdf, plot_chisqr, plot_data, plot_delchi, plot_energy_flux, plot_fit, plot_fit_delchi, plot_fit_resid, plot_model, plot_model_component, plot_order, plot_pdf, plot_photon_flux, plot_pvalue, plot_ratio, plot_resid, plot_scatter, plot_source, plot_source_component, plot_trace, set_xlinear, set_xlog, set_ylinear, set_ylog
- psfs
- plot_kernel
- statistics
- get_chisqr_plot, get_delchi_plot
- visualization
- contour_resid