LSSTDESC / imSim

GalSim based Rubin Observatory image simulation package
https://lsstdesc.org/imSim
BSD 3-Clause "New" or "Revised" License
36 stars 15 forks source link

Fringing pattern not deterministic #447

Closed rmjarvis closed 4 months ago

rmjarvis commented 9 months ago

Apparently the Python hash function is not deterministic as of Python 3.2. This is for good security-related reasons for most typical kinds of applications of hashes. But it means our fringing patterns will randomly change from one run to another (i.e. typically from one exposure to another for the way we typically run things).

cf. https://stackoverflow.com/questions/27954892/deterministic-hashing-in-python-3

I'm pretty sure this is not desirable behavior, so we should come up with a different way to convert serial_num into an integer, which is deterministic.

erykoff commented 9 months ago

This is what I have used (based on a different stack overflow which I didn't link to, sorry): https://github.com/lsst/pipe_tasks/blob/main/python/lsst/pipe/tasks/reserveIsolatedStars.py#L81-L84

rmjarvis commented 9 months ago

Fixed in #446