Re: using rplot_counts with get_combined

From: David P. Huenemoerder <dph_at_email.domain.hidden>
Date: Mon, 30 Apr 2007 16:39:56 -0400
Hi Juan, 

    juan> I'm using combine_dataset to combine HEG & MEG +-1
    juan> orders, so my script goes like:

    juan> match_dataset_grids([1,2,3,4]);
    juan> variable g = combine_datasets([1:4]);
    juan> group_data([1:4],2);
    juan> variable d = get_combined(g,&get_data_counts);

    juan> now, if I type 

    juan> rplot_counts(g);

    juan> I got the same plot than if I use

    juan> rplot_counts(1);

    juan> where 1 is the +1HEG spectrum. so it seems that
    juan> rplot_counts is not understanding g as a combination
    juan> of different orders. Any hint about this?

"g" is just an integer tag for the combined data, and happens to have
the value 1.  Since rplot_counts does not know about combined data, it
just plots histogram 1, as always.

There is a solution, but it's low level:

c = get_combined( g, &get_data_counts ) ;
m = get_combined( g, &get_model_counts ) ; 

yrange(0); hplot( c ) ;
yrange;    hplot( c.bin_lo, c.bin_hi, c.value - m.value );

Mike Nowak has written a suite of plotting functions which handles the
combined indices nicely and you can find them here (his .isisrc_plots

By the way, you may not want to do this:

    juan> match_dataset_grids([1,2,3,4]);

but instead do:

   > match_dataset_grids([3,1,2]);

assuming that 1,2 are HEG and 3,4 are MEG.  In the first form, you
will truncate the MEG grids to the HEG range.

If you want the MEG to be the same binning as HEG so you don't lose
HEG resolution, then you can do this:

  x = get_data_counts(3).bin_lo;
  xlo = [x[0] : x[-1]: 0.0025 ];
  rebin_dataset( 3, xlo, xlo+0.0025 ); 
  match_dataset_grids([3, 1, 2, 4]);

Then you will have HEG and MEG on the same grid with the range of the
original MEG grid.  (but if you have a weak exposure, you may not lose
by doing the 1st example in converting HEG to MEG binning).

    juan> -Also, is the residual from rplot_counts defined
    juan> equally to XSPEC delchi or chi ?

-- Dave

David Huenemoerder  617-253-4283 (o); -253-8084 (f);
MIT Kavli Institute for Astrophysics and Space Research
70 Vassar St., NE80-6065,
Cambridge, MA  02139
[Admin. Asst.: Elaine Tirrell, 617-253-7480, egt_at_email.domain.hidden
You received this message because you are
subscribed to the isis-users list.
To unsubscribe, send a message to
isis-users-request_at_email.domain.hiddenwith the first line of the message as:
Received on Mon Apr 30 2007 - 16:40:03 EDT

This archive was generated by hypermail 2.3.0 : Fri May 02 2014 - 08:35:45 EDT