get_num_par_thawed
- sherpa.astro.ui.get_num_par_thawed(id: IdType | None = None) int
Return the number of thawed parameters in a model expression.
The
get_num_par_thawedfunction returns the number of thawed parameters in the model assigned to a data set.Added in version 4.16.1: Linked components are now included without having to include them in the model expression.
- Parameters:
- id
int,str,orNone,optional The data set containing the model expression. If not given then the default identifier is used, as returned by
get_default_id.
- id
- Returns:
- npar
int The number of parameters in the model expression. This sums up all the thawed parameters of the components in the expression.
- npar
- Raises:
sherpa.utils.err.IdentifierErrIf no model expression has been set for the data set (with
set_modelorset_source).
See also
get_num_parReturn the number of parameters.
get_num_par_frozenReturn the number of frozen parameters.
set_modelSet the source model expression for a data set.
Examples
Return the number of thawed parameters for the default data set:
>>> print(get_num_par_thawed())
Find the number of thawed parameters for the model associated with the data set called “jet”:
>>> njet = get_num_par_thawed('jet')