Chandra X-Ray Observatory
Skip to the navigation links
Last modified: January 2016

AHELP for CIAO 4.9 Sherpa v1


Context: contrib


Change the normalization of a model to match the data.


renorm(id=None, cpt=None, bkg_id=None, names=None, limscale=1000)


The renorm() function adjusts the normalization parameter of components in the source model so that the sum of the predicted data matches the sum of the observed data. It is similar to the guess() function but works only on the normalization parameters. It should only be used to set the parameter values before a fit, and not as a replacement for fitting a model to a dataset.

Loading the routine

The routine can be loaded into Sherpa by saying:

from sherpa_contrib.utils import *


Name Default value Description
id None Which dataset to use. If None then the default dataset, as given by get_default_id(), is used.
cpt None If `None` then the full source expression for the dataset is used, otherwise it should contain the model component to change.
bkg_id None If not None, then the normalization of the model being fit to the given background component is changed.
names None The parameter names to change (a case-insensitive comparison is made, and only the parameter name itself, not the component name, is used). The default, used when names=None, is ['ampl', 'norm'].
limscale 1000.0 The minimum and maximum limits of the normalization parameter are set to newval / limscale and newval * limscale respectively (or set to the hard limits of the paramter, whichever is more restrictive).

Example 1

sherpa> load_pha('src.pi')
sherpa> subtract()
sherpa> notice(0.5, 7)
sherpa> set_source( *
sherpa> renorm()

Adjust the normalization of the gal component before fitting.

Example 2

sherpa> load_image('src', 'img.fits')
sherpa> set_source('src', gauss2d.src + const2d.bgnd)
sherpa> renorm('src')

Change the normalization of the src component used to fit dataset 'src'. The background component (bgnd) is not changed since const2d has no parameter called 'ampl' or 'norm'.

Example 3

sherpa> set_source(12, gauss2d.src12 + const2d.bgnd12)
sherpa> renorm(12, names=['ampl', 'c0'])

The normalizations of both components are changed, with each component contributing half of the signal.

Example 4

sherpa> renorm(limscale=1e4)

Change the minimum and maximum limits of the normalization parameter tp be equal to the new parameter value divided and multiplied by 1e4, respectively, rather than the default of 1e3.

Changes in the scripts 4.8.2 (January 2016) release

This routine is new in this release.


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

See Also

freeze, guess, link, paramprompt, set_par, thaw, unlink

Last modified: January 2016
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-2017. All rights reserved.