Ticket #7601 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Calculate in plane angle properly

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: critical Milestone: Release 2.6
Component: Diffraction Keywords:
Cc: nick.draper@… Blocked By:
Blocking: Tester: Gesner Passos

Description

The calculations introduced in #7012 are correct, but the way that I implemented the linear algebra in numpy is incorrect. This issue meant that I was unable to calculate the in-plane angles correctly, and so left that calculation out.

  • Explicitly convert to numpy.matrix, to peform the transform to orthonormal coordinates. A single angle should be returned.
  • Correctly calculate the in plane angles and return that angle in addition to the others
  • Unit test all results

Change History

comment:1 Changed 7 years ago by Owen Arnold

  • Status changed from new to inprogress

refs #7601. Inplane angles calculated and returned.

Inplane angles calculated from cross product of two directions. Angle calculated w.r.t target reflection. Fix issue with linear algebra and apply unit tests to all.

Changeset: fe3b2196dcd2ee4fbd98a163c0fccbe3ba2f1148

comment:2 Changed 7 years ago by Owen Arnold

  • Cc nick.draper@… added

comment:3 Changed 7 years ago by Owen Arnold

I wouldn't normally make a change this close to the release, but the outputs of the previous were essentially wrong, even though the calculation was correct. This would have made it unusable. The changes relate to python scripts, which are newly introduced, so the probability of side-effects are small.

comment:4 Changed 7 years ago by Owen Arnold

Tester: A test script would be something like this:

from CrystalTools.ExtendedUnitCell import *

horizontal1 = [0, 1, 0]
horizontal2 = [0, 0, 1]
reflectionOfInterest =  [1 ,1 ,1]
cell = createFromLatticeParameters(1, 1, 1, 90, 90, 90)
xAngle, yAngle, zAngle = cell.recAnglesFromReflections(horizontal1, horizontal2, reflectionOfInterest)

print xAngle, yAngle, zAngle 

You can also use the table in ​http://www.cleanroom.byu.edu/EW_orientation.phtml to verify the results, and formulate further tests. This has been used to construct the unit tests (ExtendedUnitCellTest.py)

comment:5 Changed 7 years ago by Owen Arnold

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

comment:6 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying
  • Tester set to Gesner Passos

comment:7 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/7601_inplane_angles'

comment:8 Changed 7 years ago by Gesner Passos

It corrects the calculation of a module introduced in this release, so it deserves be correct now. The unit tests ensure that the corrections now receives the correct results. And the proposed test works nice. I also agree that the side effects are really improbable.

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8446

Note: See TracTickets for help on using tickets.