About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/group.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 group Context: sherpa

Synopsis

Causes Sherpa to apply a read-in bin grouping scheme to source or background data.

Syntax

sherpa> [B]GROUP [# [ID]]

GROUP is used to group source data, while BGROUP is used to group
background data.

# specifies the number of the dataset to which the grouping scheme is
to be applied (default dataset number is 1). The ID modifier is used if
and only if the Sherpa state object variable multiback is set to 1,
i.e., if more than one background dataset is to be associated with a
single source dataset. The ID modifier may be any unreserved string
(e.g., A, foo, etc.), i.e., a string that is not a parsable command.

Description

The commands GROUP and UNGROUP allow a user to toggle back and forth between the analysis of grouped and ungrouped data, after grouping assignments have been read into Sherpa via the command READ GROUPS. (In a future version of Sherpa, the GROUP may be issued automatically upon the reading in of groups.)

Note the issuing the GROUP causes Sherpa to delete any defined filters for the specified dataset.

Also note that even if the data are grouped, the user may continue to read in filters, weights, etc., whose values map to the ungrouped data; Sherpa will do the grouping automatically:

  • weights are averaged within groups;
  • statistical and systematic errors are added in quadrature within groups;
  • a grouped bin is noticed if any of its ungrouped component bins is noticed.

The user may also read in filters, weights, etc., whose values map to the grouped data; these values are used directly.

NOTE: in CIAO 3.0, the commands GROUP and UNGROUP may not be used with PHA data that has a GROUPING column. This is because these data are grouped before Sherpa ever has control of them, and Sherpa thus has no knowledge of how the ungrouped data are distributed among bins. This will be changed in a future version of Sherpa.

Example

Input data from an ASCII file; input a grouping scheme; group and ungroup the data:

sherpa> ERASE ALL
sherpa> $more spec_short.dat
   1     59.0000        0       1       1       .05     0
   2     46.0000        0       1       1       .05     0
   3     49.0000        0       1       1       .05     5
   4     65.0000        0       -1      1       .05     0
   5     60.0000        2       -1      1       .05     0
   6     60.0000        2       1       .1      .05     0
   7     74.0000        2       -1      .1      .05     0
   8     58.0000        2       -1      .1      .05     0
   9     55.0000        2       1       .1      .05     0
   10    70.0000        1       -1      .1      .05     5
   11    61.0000        1       -1      .1      .05     0
   12    75.0000        1       1       1       .05     0
   13    56.0000        1       -1      1       .05     0
   14    60.0000        1       -1      1       .05     0
   15    45.0000        1       1       1       .05     0
   16    63.0000        1       -1      1       .05     5
   17    63.0000        1       -1      1       .05     0
   18    56.0000        0       1       1       .05     0
   19    58.0000        0       -1      1       .05     0
   20    54.0000        0       -1      1       .05     0
sherpa> DATA spec_short.dat
sherpa> READ GROUPS spec_short.dat 1 4
sherpa> GROUP
WARNING: any applied filters are being deleted!
sherpa> WRITE DATA
Write X-Axis: Bin  Y-Axis: Flux (Counts)
          1         59
          2         46
          3        174
          6        192
          9        186
         12        191
         15        171
         18        168
sherpa> UNGROUP
WARNING: any applied filters are being deleted!

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.