Loving ISIS - Confessions of a Former XSPEC User

 

Grouping the Data:

ISIS has the ability to dynamically group a spectrum during an analysis session. You're not just rebinning the plots, you're rebinning the data. This is a very powerful ability. With great power, however, comes great responsibility. ISIS expects you to rebin your data during the analysis session; therefore, it ignores any default binning in the FITS file header.

ISIS provides several intrinsic functions for rebinning data, among which are:

     group_data(id, factor);     % Group data by number of channels
     rebin_data(id, # or array); % Group data by minimum counts (or using array)
These functions start at short wavelength and follow a wavelength ascending order. Additionally, with the use of the intrinsic function set_rebin_error_hook, they allow you to control how error propagation is handled. (ISIS pretty much gives you full control over errors and statistics - but that is a topic for a later page.)

Being somewhat more used to the FTOOLS approach using grppha, I have written a series of functions that mimic and expand upon that tool's abilities:

    grppha(id,mincounts);
    grppha_cut(id,mincounts,minkev);
    grppha_min(id,mincounts,minchans,minkev);
    grppha_sn(id,minsn,minkev);
    grppha_sn_min(id,minsn,minchans,minkev);
    grppha_sys(id,minsn,sys,minkev);
These functions start at low energy, and follow an energy ascending order. Also, they will work simultaneously on multiple data sets, or on combined data sets. (ISIS allows you to add data in memory. This has advantages over adding pha and response files outside of the rogram, in that you can apply different models or fit kernels, e.g., pileup, to the seperate data sets that comprise the sum.)

For the purposes of this example, there are two that we care about: grppha_cut, and grppha_sn. The first was used to group the PCA data to a minimum number of counts per bin, starting above a lower energy threshold. (If we're only going to throw it out in a moment, why group it?). The second was used to group the HEXTE data, again above a lower energy threshold, to a minimum signal-to-noise per bin (properly including the background counts in the calculation of signal-to-noise). The latter is especially useful for something like HEXTE where there is a large, but well-measured background, and therefore grouping by a minimum number of counts would have been completely inappropriate.

Ignoring Data:

ISIS has a number of intrinsic functions:

     ignore(id);         % Ignore dataset id
     notice(id,a,b);     % Notice wavelength range [a,b] in dataset id
     notice_en(id,a,b);  % Notice energy range [a,b] in dataset id
     xnotice(id,a,b);    % *Only* notice wavelength range [a,b] in dataset id
     xnotice_en(id,a,b); % *Only* notice energy range [a,b] in dataset id
I have made my own function: kev_note([id],[lo],[hi]);, which is similar to xnotice_en, except that [lo] and [hi] can be arrays with lo/hi energy bounds, and any bin with zero counts is also ignored. (I have also written chan_note to work via channel numbers instead.)

For the purposes of this example, the grouping and noticing commands were run as follows:

     set_systematics(pca_id,[0],[50],[0.005]);
     grppha_cut(pca_id,30,3.);
     kev_note(pca_id,3.,22.);

     grppha_sn(hexte_id,20.,18.);
     kev_note(hexte_id,18.,200.);

My function set_systematics(), used above, is discussed on the next page.


This page was last updated Mar 22, 2006 by Michael Nowak. To comment on it or the material presented here, send email to mnowak@space.mit.edu.
Valid HTML 4.01! Made with JED. Viewable With Any Browser.