JohannesBuchner / BXA

Bayesian X-ray analysis (nested sampling for Xspec and Sherpa)
https://johannesbuchner.github.io/BXA/
GNU General Public License v3.0
57 stars 19 forks source link

an error in gof.py #18

Closed ellot closed 6 months ago

ellot commented 3 years ago

I use BXA in pyxspec. In some cases, there are nan values in lowmodel_parts. So the assert error is reported in line 85 of gof.py. I find some values of kplusones equal 0 (line 78, 79).

JohannesBuchner commented 3 years ago

Hmm, doesn't that mean data was <0 somewhere? Are you using binning on non-count data somehow?

ellot commented 3 years ago

Yes, in few cases, the net counts (subtracting background) is <0.

JohannesBuchner commented 3 years ago

That code (binning function) is only supposed to be run on count data, not subtracted data.

JohannesBuchner commented 3 years ago

Probably the exception should be raised earlier, in the binning function.

JohannesBuchner commented 6 months ago

Please reopen this if you still have the issue, and provide a code example with data.