Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] fix pmcx dettpsf overwrites input bug, close #208 #209

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading