Ticket #4680 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

MoveComponent gives wrong theta values

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: critical Milestone: Release 2.0
Component: Mantid Keywords:
Cc: timothy.charlton@… Blocked By:
Blocking: Tester: Stuart Campbell

Description

Incorrect theta values calculated after movecomponent. Issue reported by Tim Charlton.

It seems the issue is a result of the fact that the magnitude of theta is calculated correctly, but the sign of the theta value is never correctly accounted for. This is happening in the V3D::angle method, whereby the dot product of the vectors are used to calculate an angle between them, but the sign information is effectively thrown away.

Attachments

TestScript.py (1.1 KB) - added by Owen Arnold 9 years ago.

Change History

comment:1 Changed 9 years ago by Owen Arnold

The fix is simple, but we require quite a bit of support functionality and also we're a little nervous at this stage in our development cycle of doing anything that could have wider/breaking changes. The solution is probably as follows:

  • Modify the instrument definition reading code to include the referenceframe. This is currently ignored, but will be needed to figure out the quadrants.
  • Expose the additional instrument definition information (in new ReferenceFrame type) via Insrument and IInstrument
  • Create an additional method on each detector to correctly calculate signed theta using ReferenceFrame information from IInstrument. Also expose this to IDetector and any other derived types.
  • Expose the method to python.
  • In algorithms converting to theta, code an option to convert to signed theta and expose that to python too.

comment:2 Changed 9 years ago by Owen Arnold

refs #4680. Extract ReferenceFrame information

Changeset: 88357166adf9ae1426c07b418e2fcf094bb15c2b

comment:3 Changed 9 years ago by Owen Arnold

refs #4680. New detector calculation added and tested

Changeset: 9b7382965cd217e79e0e7068f28d84d52cdbfbd4

comment:4 Changed 9 years ago by Owen Arnold

refs #4680. Calculates correctly. Changes are...

Additions to old python API to get the ReferenceFrame. Implementation as part of MatrixWorkspace and temp change to MantidUI to use the new method.

Changeset: 42c77112a6c0188c8c509ea74930ffe663e4ec2e

comment:5 Changed 9 years ago by Owen Arnold

refs #4680. Expose to new python API.

Changeset: 1f8e6141da17fb272346f7590ac461ef51b69ae6

comment:6 Changed 9 years ago by Owen Arnold

refs #4680. Fix GCC error. Extra qualifier.

Changeset: 3d30fe0f687731809ee472c659d084e31f83eef3

comment:7 Changed 9 years ago by Owen Arnold

refs #4680. Fix GCC error. Add std exception header.

Changeset: ddf6d1d5c632ca122e732c9270b3fe4448969ee6

comment:8 Changed 9 years ago by Owen Arnold

refs #4680. Fix New Python API Test.

Changeset: 23c5a1cfd3aab45c8b7c9ac20fcaaf76bd0ac974

comment:9 Changed 9 years ago by Owen Arnold

refs #4680. Instrument parameter applies signed TwoTheta switch.

Changeset: 7718e2743e3427eba56d3254c9aab65bb39cc4b4

comment:10 Changed 9 years ago by Owen Arnold

refs #4680. Convert spectrum axis can use signed_theta.

Changeset: e52b2c4b06c49919346247f28c2e6e0c518bf639

comment:11 Changed 9 years ago by Owen Arnold

refs #4680. Refactor for speed. Use boost bind and boost funtion.

Changeset: 7e6c770de84ae3fcccd37c9faf9d704bc03dbe9a

Changed 9 years ago by Owen Arnold

comment:12 Changed 9 years ago by Owen Arnold

  • Status changed from new to accepted

Tester: Verify this ticket as follows

  • Ensure that all new and existing unit tests pass
  • Ensure that ConvertSpectrumAxis has new option 'signed_theta' as Target
  • Ensure all existing instrument definitions load

Then run TestScript.py (I'll email input workspace on request)

  • viewing theta in detector table for tl2_1 in WorkspaceGroup tl2 should have negative values linearly increasing to positive values
  • ColorMap of tl2_1 should show a faint upward curving line corresponding to the refraction tail

comment:13 Changed 9 years ago by Owen Arnold

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

Tester: Verify this ticket as follows

  • Ensure that all new and existing unit tests pass
  • Ensure that ConvertSpectrumAxis has new option 'signed_theta' as Target
  • Ensure all existing instrument definitions load

Then run TestScript.py (I'll email input workspace on request)

  • viewing theta in detector table for tl2_1 in WorkspaceGroup tl2 should have negative values linearly increasing to positive values
  • ColorMap of tl2_1 should show a faint upward curving line corresponding to the refraction tail

comment:14 Changed 9 years ago by Stuart Campbell

  • Status changed from verify to verifying
  • Tester set to Stuart Campbell

comment:15 Changed 9 years ago by Martyn Gigg

Refs #4680. Update system test result with param map change.

The addition of a new parameter has altered the parameter map. The data was checked. This result just updates the parameter map.

Changeset: 1b4a9be0ff51a1d666560c2df5f797af22cf3f2c

comment:16 Changed 9 years ago by Stuart Campbell

  • Status changed from verifying to closed

comment:17 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5527

Note: See TracTickets for help on using tickets.