Last modified: December 2023

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/freeze.html
Jump to: Description · Examples · PARAMETERS · Notes · Bugs · See Also


AHELP for CIAO 4.16 Sherpa

freeze

Context: modeling

Synopsis

Fix model parameters so they are not changed by a fit.

Syntax

freeze(*args)

args - sequence of str or Parameter or Model

Description

The arguments can be parameters or models, in which case all parameters of the model are frozen. If no arguments are given then nothing is changed.


Examples

Example 1

Fix the FWHM parameter of the line model (in this case a `gauss1d` model) so that it will not be varied in the fit.

>>> set_source(const1d.bgnd + gauss1d.line)
>>> line.fwhm = 2.1
>>> freeze(line.fwhm)
>>> fit()

Example 2

Freeze all parameters of the line model and then re-fit:

>>> freeze(line)
>>> fit()

Example 3

Freeze the nh parameter of the gal model and the abund parameter of the src model:

>>> freeze(gal.nh, src.abund)

PARAMETERS

The parameter for this function is:

Parameter Definition
args The parameters or models to freeze.

Notes

The `thaw` function can be used to reverse this setting, so that parameters can be varied in a fit.


Bugs

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

See Also

contrib
renorm
fitting
fit
modeling
guess, link, paramprompt, set_par, thaw, unlink