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. 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 David Huenemoerder 617-253-4283 (o); -253-8084 (f); http://space.mit.edu/home/dph 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: unsubscribeReceived on Fri Jun 03 2011 - 15:39:14 EDT
This archive was generated by hypermail 2.3.0 : Fri May 02 2014 - 08:35:47 EDT