| AHELP for CIAO 4.5 Sherpa v1 | set_grouping |
Context: data |
Synopsis
Apply user-defined grouping to a dataset
Syntax
set_grouping( [id,] val [,bkg_id=None] )
Description
The set_grouping command applies a user-defined grouping scheme to the dataset, overriding any grouping contained within the PHA file.
- 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")
- val - an array defining the grouping or quality. Must be the same length as the input data set. An element set to 1 marks the beginning of a group and an element set to -1 marks subsequent members of that group.
- bkg_id - the id of the background, if the grouping is to be applied to the background data; default=None
Example 1
sherpa> set_grouping([1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, ...] )
A grouping array is applied to dataset 1.
Example 2
sherpa> grpsrc=get_data().grouping
sherpa> set_grouping("src", grpsrc)
sherpa> set_grouping("src", grpsrc, 1)Retrieve the grouping object of dataset 1 as "grpsrc". Apply this grouping to the source and background of the "src" dataset.
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- confidence
- set_conf_opt, set_covar_opt, set_proj_opt
- data
- get_grouping, group, load_grouping, set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_exposure, set_quality, set_rmf, set_staterror, set_syserror, ungroup
- filtering
- set_filter
- methods
- set_iter_method, set_iter_method_opt, set_method, set_method_opt
- modeling
- get_par, set_bkg_model, set_full_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
- saving
- save_grouping
- statistics
- set_prior, set_sampler, set_sampler_opt, set_stat
- utilities
- set_analysis, set_default_id
- visualization
- image_setregion

![[Sherpa Logo]](../imgs/sherpa_logo_navbar.gif)