Re: background

From: David P. Huenemoerder <dph_at_email.domain.hidden>
Date: Tue, 24 Feb 2009 16:43:49 -0500
Hi Maurice - 

    Maurice> I have a few questions about the treatment of background
    Maurice> in isis that are not totally clear to me from the manual:

I agree that analysis with backgrounds could use a little more
documentation.

I have used the features a bit for LETG/HRC-S data, for which the
background is strong.

    Maurice> 1. Suppose I have a spectrum with corresponding response
    Maurice> and background files, and I use "define_back" to load the
    Maurice> background file and associate it with the spectrum.

    Maurice> What does this do? Does it subtract the background from
    Maurice> the data before a model is fit to it, like xspec? Or does

NO!

    Maurice> it add onto the model in lieu of an explicitly modeled
    Maurice> background? If the latter is true, how does the fit
    Maurice> algorithm account for the statistical error on the
    Maurice> background?

It adds the background to the model counts. I think the statistics are
done implicitly.  The background has noise, and will be accumulated
into the statistic.

    Maurice> Also, is "define_back" sufficient to include a treatment
    Maurice> of the background in spectral fitting, or must further
    Maurice> steps be taken during the fitting process?

I could be sufficient.  Another approach I have taken, and intend to
docuement sometime, is to fit the background and store the smooth
version.  I think that would be better statistically since it is a
smooth count rate rather than a noisy empirical value.


    Maurice> 2. I can load a type I pha spectrum with corresponding
    Maurice> type I pha background (e.g. XMM RGS data). What about
    Maurice> HETGS data? The background information is contained in

Do you REALLY REALLY need background for your HETG spectrum?  it is
about 1 count per megasec per resolution element.  And also, much of
it is the frame-shift aliased spectral events.

But if you do, use the contrib script, tg_bkg, which sums the
backgrounds, sums backscale, and writes a new file.  Then you can use
dmtype2split to copy it to type I pha.  E.g.:

  tg_bkg pha2 pha2_bg 

  dmtype2split \
    mode='hl' \
    verbose='0' \
    outfile='pha2_bg_-1[SPECTRUM],pha2_bg_1[SPECTRUM]' \
    infile='pha2_bg' \
    clobber='yes'

(you have to give it the SPECTRUM extension name to be able to use it
later). 

    Maurice> the columns BACKGROUND_UP and _DOWN of the main type II
    Maurice> pha spectrum file, or it can be split off into a separate
    Maurice> type II file. But "define_back" only takes type I pha
    Maurice> files. Does this mean I need to split off the background
    Maurice> into type I pha files? Or is there a more elegant way to
    Maurice> do this?

It could be done in-memory, I suppose, but no one has written an script
for that.


    Maurice> 3. How can I plot a background subtracted spectrum?

Grab Mike Nowak's fancy plotting routine - if a background is defined,
it subtracts it.  this is a link to his docs:

http://space.mit.edu/home/mnowak/isis_vs_xspec/functs.html 

I've attached fancy_plots.sl (which he calls .isisrc_plots).

Actually, his docs look a bit old.  the functions are now

plot_counts( n ); 
plot_data( n ) ; 
plot_unfold( n);

n can be an array, and it will plot all of the histograms.
Unless one or more of n are <0, then it combines them.

type 

 plot_counts;

for general usage


    Maurice> I also have one other unrelated question. When I load XMM
    Maurice> RGS data into isis, I can only plot it in
    Maurice> keV. _isis_plot.x_unit does not seem to affect this. How
    Maurice> can I change back to Angstrom?

Should be possible with plot_unit("a") and it's inverse,
plot_unit("kev").

In "fancy_plots", use Plot_Unit( "a" ).



-- 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:
unsubscribe

Received on Tue Feb 24 2009 - 19:47:08 EST

This archive was generated by hypermail 2.2.0 : Tue Feb 24 2009 - 19:51:44 EST