You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a general description of the issue or problem.
It turns out that the gain correction (if applied) being performed in fitting_legacy is not being done in the same way as XSPEC, it was doing it more like another package (see gainshift in here).
XSPEC will gain shift the photon energy grid of the spectral response. This is done by defining a new energy grid with the equation $E_{new}=E_{old}/G_{slope} - G_{offset}$ for the photon axis of the SRM then evaluating the photon model at these new energies and interpolating the effective areas (if present) to the $E_{new}$.
The way fitting_legacy does it at the minute is by defining a new energy grid with the same equation but on the output count axis grid. The output model is then interpolated to the $E_{new}$ and compared to the data.
One thing to figure out is which way is the correct way to gain shift.
At the minute, this only affects fitting_legacy but has implications on how things may need to be implemented/made available during the refactor.
I expect this to turn into a discussion and more should be added, but this is maybe a good start! (although it seemed to have started a while ago elsewhere)
The text was updated successfully, but these errors were encountered:
"gain" is the conversion from ADC to count energy, generally linear which i guess NuSTAR assumes across its valid range
for a diagonal matrix i reckon it wouldn't make a difference. for non-diagonal matrices (as things tend to be at higher energies like >100 keV) i would be surprised if interpolating the photon axis is the way to go.
fundamentally if the gain is changing then interpolating either photons or counts doesn't make much sense. what should be modified is the response matrix, so that the count bin edges shift and map different incident photon energies to different count energies. this requires that the matrix be re-interpolated. for XSPEC i reckon they couldn't be bothered to code that into the 30 year old package so instead went with the photon interpolation approximation (which might work for fine enough energy bins)
Provide a general description of the issue or problem.
It turns out that the gain correction (if applied) being performed in
fitting_legacy
is not being done in the same way as XSPEC, it was doing it more like another package (seegainshift
in here).XSPEC will gain shift the photon energy grid of the spectral response. This is done by defining a new energy grid with the equation$E_{new}=E_{old}/G_{slope} - G_{offset}$ for the photon axis of the SRM then evaluating the photon model at these new energies and interpolating the effective areas (if present) to the $E_{new}$ .
The way$E_{new}$ and compared to the data.
fitting_legacy
does it at the minute is by defining a new energy grid with the same equation but on the output count axis grid. The output model is then interpolated to theOne thing to figure out is which way is the correct way to gain shift.
At the minute, this only affects
fitting_legacy
but has implications on how things may need to be implemented/made available during the refactor.I expect this to turn into a discussion and more should be added, but this is maybe a good start! (although it seemed to have started a while ago elsewhere)
The text was updated successfully, but these errors were encountered: