domeckert / pyproffit

Pyproffit is a Python code for the analysis of X-ray brightness profiles from clusters of galaxies
GNU General Public License v3.0
18 stars 4 forks source link

inconsistent profiles #16

Closed poonh closed 2 years ago

poonh commented 2 years ago

In the Deproject module,fucntion PlotSB, the "Data" is plotted as prof.counts / prof.area / prof.effexp (case A). And, in the profile extraction, i.e. function SBprofile, the profile is calculated by summing up img[id] / exposure[id] of each pixel in each bin(case B). In the ideal case like simulated data, the two cases are exactly the same. But for XMM-Newton data, I tried with a few sources and I find case B always gives a higher count rate. So, to be consistent, I modified the code in SBprofile so that the profile is calculated in the same way as case A. I am not sure whether it is suitable to do that.

domeckert commented 2 years ago

Indeed there can be small differences from one case to the other, because case A assumes an "effective" exposure for the whole annulus while case B computes the surface brightness using the exact local exposure. Therefore, case B (implemented in SBprofile) provides the most accurate measurement.

The reason why it is written in this way in the PlotSB routine is because the Multiscale routine fits the counts rather than the surface brightness, which requires the calculation of an effective exposure. The two formulae should normally give almost exactly the same result, but they can be slightly different in case the exposure map varies substantially across an annulus. Similar to what I wrote about one of your previous issues, using narrow bins should solve the issue.