Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

URL: http://cxc.harvard.edu/sherpa/ahelp/get_grouping.html
Jump to: Description · Examples · See Also


AHELP for CIAO 4.9 Sherpa v1

get_grouping

Context: data

Synopsis

Obtain the grouping flags from a data set

Syntax

get_grouping( id [,bkg_id=None] )

Description

The get_grouping command returns the array of grouping flags associated with a data set, by data set id. An array element set to 1 marks the beginning of a group and an element set to -1 marks subsequent members of that group. An array of grouping flags can be read from a FITS table file or column-based ASCII file and assigned to a data set with the load_grouping command, and the set_grouping command is used to actually apply a grouping scheme to a data set. The set_grouping and get_grouping commands require that the data set in question be a PHA data set.

  • id - the id of the data set to use (required); default=None
  • bkg_id - the id of the background, if the grouping is to be applied to the background data; default=None

Example 1

sherpa> get_grouping(1)

The get_grouping function retrieves the grouping scheme associated with data set id=1 (the data set id is a required argument).

Example 2

sherpa> get_grouping(2)

Here, an array of grouping flags is read from the ASCII file 'grouping.txt' and assigned to data set 2 (3c273.pi). The set_grouping function is used to actually apply the grouping scheme to data set 2, using the array which is returned by the get_grouping function.

sherpa> load_pha(2, "3c273.pi")
sherpa> load_grouping(2, "grouping.txt")
sherpa> get_grouping(2)

array([1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1,..., -1, -1, -1, -1, 1, -1, -1, -1, -
1, -1, -1, -1])

sherpa> set_grouping(2, get_grouping(2))

Example 3

sherpa> get_grouping(2, 1)

The get_grouping function is used to return the array of grouping flags associated with the background of source data set 2 (bkg_id=1 represents the first background data set loaded in association with the source data set id=2).

See Also

confidence
get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
contrib
get_chart_spectrum
data
get_areascal, get_arf, get_arf_plot, get_axes, get_backscal, get_bkg, get_bkg_plot, get_bkg_scale, get_coord, get_counts, get_data, get_data_plot, get_dep, get_dims, get_error, get_exposure, get_indep, get_quality, get_rmf, get_specresp, get_staterror, get_syserror, group, load_grouping, set_grouping, ungroup
filtering
get_filter
fitting
calc_stat_info, get_fit, get_stat_info
info
get_default_id, list_stats
methods
get_draws, get_iter_method_name, get_iter_method_opt, get_method
modeling
get_model, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_response, get_source, get_source_component_image, get_source_component_plot, image_source
plotting
get_split_plot
psfs
get_kernel, get_psf
saving
save_grouping
statistics
get_chisqr_plot, get_delchi_plot, get_prior, get_sampler, get_stat
utilities
get_analysis, get_rate
visualization
get_ratio, get_resid, image_getregion

Last modified: December 2013
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:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.