Skip to content

Commit

Permalink
Update imsim/lsst_image.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis authored Feb 3, 2024
1 parent 9bdee71 commit 57ec5c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imsim/lsst_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def addNoise(self, image, config, base, image_num, obj_num, current_var, logger)
camera = get_camera(self.camera_name)
det_name = base['det_name']
serial_number = camera[det_name].getSerial()
# Note: the regular Python hash function is non-derterministic, which is not good.
# Note: the regular Python hash function is non-deterministic, which is not good.
# Instead we use hashlib.sha256, which is deterministic and convert that to an integer.
# https://stackoverflow.com/questions/27954892/deterministic-hashing-in-python-3
seed = int(hashlib.sha256(serial_number.encode('UTF-8')).hexdigest(), 16) & 0xFFFFFFFF
Expand Down

0 comments on commit 57ec5c3

Please sign in to comment.