Synopsis
Calculate the equivalent width of an emission or absorption line.
Syntax
eqwidth(src, combo, [lo, hi], [id], [bkg_id])
Description
The eqwidth command calculates the equivalent width of an emission or absorption line in the source or background data. The equivalent width is reported in the units of the analysis, either energy or wavelength.
An integral over the entire energy or wavelength range of the dataset - or a specified interval - is performed to evaluate the continuum model (src) and the continuum-plus-line model (combo) at each point. The integrand is then (combo-src)/src.
- src - model expression that describes the continuum
- combo - model expression that describes the continuum plus the line
- lo - low energy/wavelength limit; default=None
- hi - high energy/wavelength limit; default=None
- id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")
- bkg_id - the id of the background to use; default is the first background dataset
The src and combo model expression components must be established, e.g. with set_source or set_model(), before they can be used by eqwidth.
Examples
Example 1
sherpa> set_source(powlaw1d.cont + gauss1d.eline) sherpa> eqwidth(cont, cont+eline) 0.535073
Define 1D gaussian and powerlaw models, then use them to find the equivalent width of the line.
Example 2
sherpa> set_bkg_source(2, const1d.c1+gauss1d.line) sherpa> eqwidth(c1, c1+line, lo=2., hi=10., id=2, bkg_id=1)
Define 1D constant and powerlaw models for background data set 1 associated with source data set 2, then use them to find the equivalent width of the line between 2.0 and 10.0 keV.
Example 3
sherpa> set_source("src", bbody.bb+powlaw1d.pl+gauss1d.line1+gauss1d.line2) sherpa> eqwidth(bb+pl, bb+pl+line1, "src") 0.454946
Model components from the source model are used to calculate the equivalent width of a line in dataset "src".
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- data
- get_bkg_plot
- info
- list_model_ids, show_bkg_model, show_bkg_source
- modeling
- add_model, add_user_pars, clean, create_model_component, delete_bkg_model, delete_model, delete_model_component, get_model, get_model_autoassign_func, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_source, get_source_component_image, get_source_component_plot, image_model, image_model_component, image_source, image_source_component, integrate, link, load_table_model, load_template_model, load_user_model, normal_sample, reset, save_model, save_source, set_bkg_model, set_full_model, set_model_autoassign_func, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset, t_sample, uniform_sample
- plotting
- get_lrt_plot, get_lrt_results, get_pvalue_plot, get_pvalue_results, plot_cdf, plot_model, plot_model_component, plot_pdf, plot_pvalue, plot_scatter, plot_source, plot_source_component, plot_trace
- psfs
- delete_psf, load_conv
- saving
- save_delchi, save_resid
- utilities
- calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat
- visualization
- contour_model, contour_ratio, contour_resid, get_ratio, get_resid