Re: Combining and plotting HETG spectra

From: Petri Savolainen <psavolainen_at_email.domain.hidden>
Date: Sun, 05 Jun 2011 18:46:51 -0400
Thanks for the replies. Apparently the problem was mainly due to the 
grid matching, and as I wasn't combining HEG and MEG together, I just 
left that part out.

Cheers,

Petri

-- 
Petri Savolainen, Predoctoral Fellow
Smithsonian Astrophysical Observatory
Harvard-Smithsonian Center for Astrophysics
60 Garden Street, MS 67
Cambridge, MA 02138, USA
Tel: +1-617-495-7956
Email: psavolainen_at_email.domain.hidden

On 06/03/2011 03:38 PM, David P. Huenemoerder wrote:
 >      Petri>  I'm trying to combine 8 Chandra HETG spectra (two 
closely spaced
 >      Petri>  observations, HEG&  MEG +&  - 1st orders) into two (HEG& 
  MEG) spectra
 >      Petri>  in a statistically sensible way. What I was expecting to 
get is what I
 >      Petri>  see by plotting the spectra in these groups:
 >
 >      Petri>  plot_data({[1,2,5,6],[3,4,7,8]};...});
 >
 >      Petri>  Which plots two neat spectra with what I think are 
sensibly-sized error
 >      Petri>  bars. So I do the combination:
 >
 >      Petri>  variable h1_id, m1_id;
 >      Petri>  match_dataset_grids(1,2,5,6);
 >      Petri>  match_dataset_grids(3,4,7,8);
 >
 > If I understand your indexing, h = [1,2,3,4] is one obs, with 1,2 
being HEG and
 > 3,4 being MEG.  The second set is h+4.

Yes.

 >
 > To match grids, you then want to do:
 >
 > match_dataset_grids( [3, 1,2, 5,6] );
 >
 > to put 1,2,5,6 onto the 1st MEG grid.  (1,2,5,6 alread match - IF they
 > are all HEG, and 3,4,7,8 already match, if they are all MEG).
 >
 >
 >      Petri>  notice_values([1,2,5,6],1.2,9.2; min_val = 1, unit = "A");
 >      Petri>  notice_values([3,4,7,8],1.2,9.2; min_val = 1, unit = "A");
 >      Petri>  h1_id = combine_datasets(1,2,5,6);
 >      Petri>  m1_id = combine_datasets(3,4,7,8);
 >
 >      Petri>  But when I plot again (same command), the error bars are 
tiny or
 >      Petri>  nonexistent (and the chi squared quite large), and the 
residuals also
 >
 > If you want to plot as combined, I think you need a negative index on
 > the data or the combined group ID:
 >
 > plot_data( -m1_id );
 >
 > or for all combined:
 >
 > plot_data( -[1:8] );
 >
 > (and for the residuals, set popt.res = 4).
 >
 >
 >
 >      Petri>  I also tried plotting by the indices
 >
 >      Petri>  plot_data({h1_id,m1_id};...});
 >
 > This is incorrect syntax.  Those ID's would be interpreted as
 > histogram indices.  They are "handles" for the combined data.  E.g.,
 > if I do:
 >
 > g = combine_datasets( [1,2,3,4] );
 >
 > then g = 1.
 >
 > print( combination_members( g ) );
 >
 > would show me the members.
 >
 >
 >      Petri>  But this produces an even weirder plot, with the HEG 
spectrum looking
 >      Petri>  like spectrum 1 and the MEG spectrum missing both error 
bars and residuals.
 >
 >
 > I'm not sure what you really want to do.  If you want to combine HEG
 > and MEG, then you need to match grids.  If you just want to combine
 > MEG,  and combine HEG, then you don't have to match grids.  E.g., for
 > the latter case:
 >
 > heg_idx = [ 1,2, 5,6 ];
 > meg_idx = heg_idx + 2 ;
 >
 > gm = combine_datasets( meg_idx ) ;
 > gh = combine_datasets( heg_idx ) ;
 >
 > plot_data( -gm, popt );
 > plot_data( -gh, popt) ;
 >
 > (where popt is the structure that plot_data wants, and I set fields
 > appropriately).
 >
 >
 > combine_datasets sets a flag which means that when you do a fit, the
 > counts get summed, the model counts get summed, then the statistic
 > gets evaluated.  Extra work (plot_data, plot_counts, plot_unfold, from
 > Mike Nowak) are needed to do the visualization.
 >
 > Hope this helps.
 >
 >
 > -- Dave
----
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:
unsubscribe
Received on Sun Jun 05 2011 - 18:47:05 EDT

This archive was generated by hypermail 2.2.0 : Sun Jun 05 2011 - 19:48:24 EDT