Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/grpbinfile.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.16

grpBinFile

Context: group

Synopsis

Group an array using the grouping applied to another dataset.

Syntax

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

Returns: ( PyArray_Type grouping, PyArray_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.

The group module is not available by default; to use it in a Python program, it must be loaded using the Python import function:

  from group import *, or import group

Examples

Example 1

>>> ( grp, qual ) = grpBinFile( spec2, spec1, spec1GROUPING,
spec1QUALITY )

The grpBinFile() routine is used to calculate the grouping and quality arrays and apply the grouping from one spectrum to another.

Example 2

To see more examples of optional parameters and keywords in the parameter list, please see ahelp grpadaptive


Bugs

See the bugs page for the group library on the CIAO website for an up-to-date listing of known bugs.

Refer to the CIAO bug pages for an up-to-date listing of known issues.

See Also

group
group, grpadaptive, grpadaptivesnr, grpbin, grpbinfile, grpbinwidth, grpgetchanspergroup, grpgetgroupsum, grpgetgrpnum, grpmaxslope, grpminslope, grpnumbins, grpnumcounts, grpsnr