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/grpbinfile.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 grpBinFile Context: group

Synopsis

Group an array using the grouping applied to another dataset.

Syntax

grpBinFile( Array_Type axisArray, Array_Type fAxisArray, Array_Type
fGroupingCol, Array_Type fQualCol )
grpBinFile( Array_Type axisArray, Array_Type fAxisArray, Array_Type
fGroupingCol, Array_Type fQualCo, Array_Type tabStops )

Returns: ( Array_Type grouping, Array_Type quality )

Description

This function allows you to calculate the grouping information needed to group the input data (the axisArray array) to match the grouping of another dataset (the fAxisArray, fGroupingCol, and fQualCol arrays which can be read from a file). Often you can apply the grouping information directly - i.e. call

grpGetGroupSum( axisArray, fGroupingCol )

rather than grpBinFile() - unless the two datasets do not have the same set of axis values. An example of this is when different binning factors are used to create spectra, e.g. calling dmextract with

[bin pha=1:4096:4]

and

[bin pha=1:4096:1]

To apply the grouping calculated from one of these spectra to the other one requires the use of grpBinFile().

This function provides the same functionality as the BIN_FILE option of dmgroup.

Example

chips> pha1 = readbintab( "spec1.pi" )
chips> pha2 = readbintab( "spec2.pi" )
chips> ( grp, qual ) = grpBinFile( pha2.PI, pha1.PI, pha1.GROUPING,
pha1.QUALITY )

In this example we read in the data from two spectra which were binned on the PI channel. The grpBinFile() routine is used to calculate the grouping and quality arrays for spec2.pi that match the grouping applied to spec1.pi.

Note that readbintab() was used to read in both files; readpha() should not be used since this automatically applies the grouping information when reading in the data, and the resulting data can not be used in grpBinFile() since information has been lost.

Bugs

See the bugs page for the group library on the CIAO website 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.