Skip to content

Commit

Permalink
fix pmcx dettpsf overwrites input bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fanyuyen committed Feb 23, 2024
1 parent e28fd4c commit 90e2419
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pmcx/pmcx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def dettpsf(detp, detnum, prop, time):
output:
tpsf: caculated temporal point spread function curve of the specified detector
"""
detp = detp.copy()

# select the photon data of the specified detector
detp["ppath"] = detp["ppath"][detp["detid"] == detnum, :]
detp["detid"] = detp["detid"][detp["detid"] == detnum]
Expand Down Expand Up @@ -370,7 +372,9 @@ def detphoton(detp, medianum, savedetflag, issaveref=None, srcnum=None):
newdetp["detid"] = detp[0, :].astype(int).transpose()
if np.any(newdetp["detid"] > 65535):
newdetp["srcid"] = np.right_shift(newdetp["detid"], 16, dtype=np.int32)
newdetp["detid"] = np.bitwise_and(newdetp["detid"], 0xff, dtype=np.int32)
newdetp["detid"] = np.bitwise_and(
newdetp["detid"], 0xFF, dtype=np.int32
)
c0 = 1

length = medianum
Expand Down

0 comments on commit 90e2419

Please sign in to comment.