Ticket #3923 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

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

comment:1 Changed 9 years ago by Martyn Gigg

  • Description modified (diff)

comment:2 Changed 9 years ago by Martyn Gigg

  • Description modified (diff)

comment:3 Changed 9 years ago by Martyn Gigg

  • Status changed from new to verify
  • Resolution set to fixed

In [15160]:

Fixes #3923. Fix the phi averaging for DetectorGroups that was wrong in certain situations like on an edge.

comment:4 Changed 9 years ago by Martyn Gigg

In [15166]:

Refs #3923. New reference file for a minor tweak to the cylinder absorption that is small and understood but above current test tolerance.

comment:5 Changed 9 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:6 Changed 9 years ago by Russell Taylor

  • Status changed from verifying to closed

Looks good.

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4770

Note: See TracTickets for help on using tickets.