# Re: Formula for converting a spectrum model to counts

From: John Houck <houck_at_email.domain.hidden>
Date: Wed, 22 Dec 2010 09:44:16 -0500
On Wed, Dec 15, 2010 at 15:52 -0800, Rob Gibson wrote:
> 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.)

The exposure time and background scaling aren't explicit in the
above expression, but the expression is essentially accurate.

> 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.

Because the integral is discretized, the model values must be
bin-integrated.

> 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

Yes, the bin-integration is necessary.

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

Isis uses a wavelength grid internally, but since it doesn't
move the bin edges.  For the purposes of checking the
calculation, the units shouldn't be important.

Thanks,
-John
----
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:44:20 EST

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