Skip to content

Commit

Permalink
Fix PC conventions and add a changelog (#10)
Browse files Browse the repository at this point in the history
* Fix PC conventions by indexing correct into NumPy Fortran array

Signed-off-by: Håkon Wiik Ånes <[email protected]>

* Add a changelog following "Keep a Changelog"

Signed-off-by: Håkon Wiik Ånes <[email protected]>

* Use float

Signed-off-by: Håkon Wiik Ånes <[email protected]>
  • Loading branch information
hakonanes authored Feb 11, 2022
1 parent 9597566 commit 3096d4b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=========
Changelog
=========

All notable changes to PyEBSDIndex will be documented in this file. The format is based
on `Keep a Changelog <https://keepachangelog.com/en/1.1.0>`_.

Unreleased
==========

Added
-----
- PC conventions for Bruker, EDAX, EMsoft, kikuchipy, and Oxford.
17 changes: 8 additions & 9 deletions pyebsdindex/band_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,24 +401,23 @@ def radon2pole(self,bandData,PC=None,vendor='EDAX'):
stheta = np.sin(theta)
ctheta = np.cos(theta)

t = (np.asfarray(PC)).copy()
t = np.asfarray(PC).copy()
shapet = t.shape
if len(shapet) < 2:
t = np.tile(t, nPats).reshape(nPats,3)
else:
if shapet[0] != nPats:
t = np.tile(t[0,:], nPats).reshape(nPats,3)


dimf = np.array(self.patDim, dtype=np.float32)
if (ven in ['EDAX', 'OXFORD']) :
t *= np.array([dimf[1],dimf[1],-1.0 * dimf[1]])
if (ven == 'EMSOFT'):
t += np.array([dimf[1] / 2.0,dimf[0] / 2.0,0.0])
t[2,:] *= -1.0
if ven in ['EDAX', 'OXFORD']:
t *= np.array([dimf[1], dimf[1], -dimf[1]])
if ven == 'EMSOFT':
t += np.array([dimf[1] / 2.0, dimf[0] / 2.0, 0.0])
t[:, 2] *= -1.0
if ven in ['KIKUCHIPY', 'BRUKER']:
t *= np.array([dimf[1],dimf[0],-1.0 *dimf[0]])
t[1,:] = dimf[0] - t[1,:]
t *= np.array([dimf[1], dimf[0], -dimf[0]])
t[:, 1] = dimf[0] - t[:, 1]
# describes the translation from the bottom left corner of the pattern image to the point on the detector
# perpendicular to where the beam contacts the sample.

Expand Down

0 comments on commit 3096d4b

Please sign in to comment.