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

getPhi for a DetectorGroup is not right in some circumstances #4770

Closed
martyngigg opened this issue Oct 7, 2011 · 1 comment
Closed

getPhi for a DetectorGroup is not right in some circumstances #4770

martyngigg opened this issue Oct 7, 2011 · 1 comment
Assignees
Milestone

Comments

@martyngigg
Copy link
Member

DetectorGroup::getPhi() currently computes the individual phi values for each member and averages these. This does not give the same value as if you get the position of the group first and then compute the phi value like this

import math
def calculatePhi(detector)
    pos_xyz = detector.getPos()
    return math.atan2(pos_xyz[1],pos_xyz[0]) # radians

To test, use a workspace that has been grouped and then in python do

det = workspace.getDetector(index) # index of group
wrong_phi = det.getPhi()
phi = calculatePhi(det)
# The value will not match
@martyngigg
Copy link
Member Author

This issue was originally trac ticket 3923

@martyngigg martyngigg self-assigned this Jun 3, 2015
@martyngigg martyngigg added this to the Release 2.0 milestone Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant