-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unfolded data #82
Comments
See also Mike Nowak's conference proceeding, X-ray and Radio Monitoring of GX 339-4 and Cyg X-1, especially §3, "A Rant on the Nature of Evil". I think we should implement two ways of unfolding spectra. A more "proper" way (see Mike's conference proceeding) and the XSPEC way to allow comparison with the literature. @fjebaker - since we won't use unfolded spectra for fitting (although perhaps that should just be ill advised rather than forbidden?) I was thinking of putting this in as a plot recipe. What do you think? It does require access to the data, responses, and model, but I think that is now all bundled up in the fitting result? |
Sounds good, I hadn't seen that Nowak proceeding before. Just for my own comparison, I write here how XSPEC and ISIS do their unfolded spectra and model:
where
where I read the integral as saying the response matrix summed (integrated) over the photon energy |
The response matrices are typically unit normalised but this is not always the case and I have run into two different cases: 1) response matrices that are nearly unit normalised (not sure why such things should exist), and 2) (much more commonly) combined RMF and ARF (sometimes given the extension ISIS has Typo: the integrand in the denominator of the ISIS expression should contain the term |
I don't understand how ISIS can factor out the ARF. I thought merging the RMF and ARF was a matrix multiplication so how can you invert this to find both |
Ah, right, a key point here is that the ARF is not a general matrix - it is vector (or diagonal matrix). Take a look at The Calibration Requirements for Spectral Analysis. So this means you can, at a given energy (or channel), normalise the combined response (ARF and RMF in one matrix) where This procedure will take P.S. I note that the documentation says "This format is very similar to that used originally by the XSPEC P.P.S. I also just spotted the ftools |
This was the relation I was missing! It all clicks into place now. Yes we can quite easily add those implementations into SpectralFitting.jl. I have this currently unused function in the source SpectralFitting.jl/src/datasets/response.jl Lines 62 to 72 in 94bcb07
(Edit: this code has an undefined symbol so doesn't actually run correctly, but it's a trivial fix) which normalises each row of the response matrix to 1, which is in essence your We can (and probably should) also add functions that check that the matrix is unit normalized when loading in and issue a warning to the user if not, with instructions on how to normalize the matrix. |
Infact the weights in the above function are already the ARF as in your equation, so we actually just need a wrapper function with a better name and expose it publicly. |
The text was updated successfully, but these errors were encountered: