Ticket #3923 (closed: fixed)
getPhi for a DetectorGroup is not right in some circumstances
Reported by: | Martyn Gigg | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | major | Milestone: | Release 2.0 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Russell Taylor |
Description (last modified by Martyn Gigg) (diff)
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
Change History
Note: See
TracTickets for help on using
tickets.