grouptype=bmin sets up a binning with a minimum number of counts in each bin in the background file with the minimum set using groupscale.
grouptype=constant sets up uniform binning by the factor given by groupscale. For instance, if groupscale=2 then GROUPING is set to bin by a factor of two in xspec.
grouptype=min sets up a binning with a minimum number of counts in each bin with the minimum set using groupscale.
grouptype=snmin sets up a binning with a minimum signal-to-noise ratio in each bin with the minimum set using groupscale. If a background file has been specified then the signal-to-noise will be for background-subtracted spectra.
grouptype=opt sets up a binning using the Kaastra & Bleeker (2016; A&A 587, A151) optimal binning scheme. Note that this option ignores any minchannel and maxchannel set.
grouptype=optmin sets up a binning using the Kaastra & Bleeker as for grouptype=opt, but with the additional requirement of a minimum number of counts set using groupscale. (i.e. optmin is the joint requirement of both "min" and "opt" grouptypes, whichever would group more).
grouptype=optsnmin sets up a binning using the Kaastra & Bleeker as for grouptype=opt, but with the additional requirement of a minimum signal/noise set using groupscale. (i.e. optsnmin is the joint requirement of both "snmin" and "opt" grouptypes, whichever would group more).
grouptype=file uses the GROUPING read in from the spectrum file specified by the templatefile parameter.
If minchannel and/or maxchannel are set to non-negative values then any grouping is restricted to the channel range they specify.
1. Grouping by a constant factor
ftgrouppha infile=file1.pha outfile=fileout.pha grouptype=const groupscale=42. Grouping to a minimum number of counts per bin
ftgrouppha infile=file1.pha outfile=fileout.pha grouptype=snmin groupscale=3.03. Grouping to a minimum S/N ration including background
ftgrouppha infile=file1.pha backfile=back1.pha outfile=fileout.pha grouptype=snmin groupscale=3.04. Grouping using the Kaastra & Bleeker optimal binning algorithm
ftgrouppha infile=file1.pha respfile=resp1.rmf outfile=fileout.pha grouptype=opt5. Grouping to a minimum number of counts per bin in the background file
ftgrouppha infile=file1.pha backfile=back1.pha outfile=fileout.pha grouptype=bmin groupscale=16. Grouping using the Kaastra & Bleeker optimal binning algorithm over a subset of channels
ftgrouppha infile=file1.pha respfile=resp1.rmf outfile=fileout.pha grouptype=opt minchannel=100 maxchannel=80007. Grouping using a template spectrum file
ftgrouppha infile=file1.pha templatefile=file2.pha outfile=fileout.pha grouptype=file8. Grouping using the Kaastra & Bleeker optimal binning algorithm plus minimum of 100 counts per grouped bin
ftgrouppha infile=file1.pha respfile=resp1.rmf outfile=fileout.pha grouptype=optmin groupscale=100 minchannel=100 maxchannel=80009. Grouping using the Kaastra & Bleeker optimal binning algorithm plus a minimum signal/noise of 3 per grouped bin
ftgrouppha infile=file1.pha respfile=resp1.rmf outfile=fileout.pha grouptype=optsnmin groupscale=3.0 minchannel=100 maxchannel=800010. Grouping all rows by a constant factor in a type II file
ftgrouppha infile=fileII.pha outfile=fileoutII.pha grouptype=const groupscale=411. Grouping by a constant factor in a type II file for even numbered rows
ftgrouppha infile=fileII.pha outfile=fileoutII.pha grouptype=const groupscale=4 rows="2,4,6,8"