jzuhone / pyxsim

Simulating X-ray observations from astrophysical sources.
http://hea-www.cfa.harvard.edu/~jzuhone/pyxsim
Other
20 stars 8 forks source link

dist option in make_photons is not handled correctly #54

Closed changgoo closed 1 year ago

changgoo commented 1 year ago

I found that dist option in make_photons is stored in the parameter dict without unit specifier at

https://github.com/jzuhone/pyxsim/blob/f7324bede1ac7980464b79829f552780570278f6/pyxsim/photon_list.py#L358

Then, it is restored in _project_photon by assuming that it is in Mpc and multiplied by 1.e3

https://github.com/jzuhone/pyxsim/blob/f7324bede1ac7980464b79829f552780570278f6/pyxsim/photon_list.py#L574

This makes the behavior of the dist option incorrect.

jzuhone commented 1 year ago

@changgoo can you test this patch? https://github.com/jzuhone/pyxsim/commit/9854d3009ae141048b006319d191e7de2a68d5c5

jzuhone commented 1 year ago

Fixed in version 4.2.2.