Chandra X-Ray Observatory
Skip to the navigation links
Last modified: December 2009

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.3 Sherpa v1


Context: contrib


Return the data used to create the radial or elliptical profile of the source model (before any PSF convolution) for imaging data.


get_source_prof( [id], [model=None, rstep=None, rmin=None, rmax=None,
rlo=None, rhi=None, xpos=None, ypos=None, ellip=None, theta=None,
group_counts=None, group_snr=None, recalc=True] )


The get_source_prof() command calculates the radial - or elliptical - profile of the source model of an imaging dataset and returns an object containing the values. The profile is defined by the existing model compenents, although it is possible to over-ride these values.

The model values used to calculate the profile are those before convolution by any PSF model. Please use the get_model_prof() command if you want to plot the convolved model values.

Loading the routine

The routine can be loaded into Sherpa by saying:

from sherpa_contrib.profiles import *

Argument options

The argument options are the same as for the prof_data() command - except that the overplot and label arguments are not supported - and are described in its ahelp page.

Fields returned by get_source_prof

The following table lists the fields in the object returned by the get_source_prof() command. These values can also be seen by using the print command on the object:

sherpa> d = get_source_prof(rstep=10)
sherpa> print (d)
Field name Description
xlo The lower-limits of the radial bins
xhi The upper-limits of the radial bins
y The calculated profile value (sum of model / area)
xlabel The label for the X axis
ylabel The label for the Y axis
title The plot title
histo_prefs The preferences for the plot

Example 1

sherpa> d10 = get_source_prof(group_snr=10)
sherpa> d20 = get_source_prof(group_snr=20)
sherpa> erase()
sherpa> add_histogram(d10.xlo, d10.xhi, d10.y)
sherpa> add_histogram(d20.xlo, d20.xhi, d20.y, ["line.color", "red"])
sherpa> set_plot_xlabel(d10.xlabel)
sherpa> set_plot_ylabel(d10.ylabel)

Two profiles of the same model are calculated; d10 uses a signal-to-noise ratio of 10 and d20 a value of 20. The return values are then used to plot up the profiles using ChIPS commands to compare the plots (the d20 results are shown in green).

Example 2

sherpa> prof_source("src1", group_counts=100)
sherpa> da = get_source_prof(recalc=False)
sherpa> prof_source("src2", rlo=da.xlo, rhi=da.xhi, overplot=True)
sherpa> set_histogram(["symbol.color", "orange"])

A profile is calculated and displayed for the dataset "src1". The bin edges from this are then used to create a profile for the dataset "src2", which is overlain on the first plot using orange symbols. Note that recalc is set to False in the call to get_source_prof() to avoid unnescessary re-calculations.


See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

get_data_prof, get_data_prof_prefs, get_delchi_prof, get_delchi_prof_prefs, get_fit_prof, get_model_prof, get_model_prof_prefs, get_resid_prof, get_resid_prof_prefs, get_source_prof_prefs, plot_chart_spectrum, prof_data, prof_delchi, prof_fit, prof_fit_delchi, prof_fit_resid, prof_model, prof_resid, prof_source, sherpa_profiles
get_arf_plot, get_bkg_plot
get_energy_flux_hist, get_photon_flux_hist, get_split_plot, plot, plot_arf, plot_bkg, plot_chisqr, plot_data, plot_delchi, plot_energy_flux, plot_fit, plot_model, plot_model_component, plot_order, plot_photon_flux, plot_ratio, plot_resid, plot_source, plot_source_component, set_xlinear, set_xlog, set_ylinear, set_ylog
get_chisqr_plot, get_delchi_plot

Last modified: December 2009
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email: Smithsonian Institution, Copyright © 1998-2019. All rights reserved.