# Formula for converting a spectrum model to counts

From: Rob Gibson <rrg11_at_email.domain.hidden>
Date: Wed, 15 Dec 2010 15:52:07 -0800
I'm trying to reproduce the formula used in ISIS (XSPEC, etc.) to
calculate model counts given an ARF, RMF, and flux model.

The equation is apparently:  C(h) = B(h) + \int dE R(h, E) A(E) m(E),
where R, A, and m are the RMF, ARF, and model respectively.

Can anyone tell me if the following is accurate?  (It seems to work.)
What are the gotchas here?

1) Use the CIAO tool rmfimg to convert an rmf file to a 2D R(h, E) data
structure.
2) Load A(E) directly from the ARF file.
3) m(E) returns a value of photons/keV/cm^2/s; e.g., for a powerlaw
model it would be:
m(E) = norm * Emid^(-gamma), where Emid is the center of the RMF
energy bin and (norm, gamma) are the usual powerlaw model parameters.
4) Evaluate the integral (R*A*m dE) using energy bins (Emid, dE) from
the RMF grid.
5) Convert channel h to Energy using the second data table of the
original RMF file.
6) Plot energy (converted from channel h) vs. C(h); this seems to match
plot_model_counts in bin_integral space.

Is that the correct specification of the model term m(E) in the
equation, or is does there need to be some sort of bin-integral value

Apparently ISIS evaluates these models on a wavelength grid, so would
convert the above integral to wavelength space.  Is that right?

Any comments/observations are appreciated; I want to get this right...
Rob
----
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 Wed Dec 22 2010 - 09:09:55 EST

This archive was generated by hypermail 2.2.0 : Tue Nov 13 2012 - 08:45:43 EST