EMsoft-org / EMsoft-org/EMsoftOO

EMEBSDmaster: Regularly spaced black pixels when Hall SG is used with hexagonal sampling

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Fortran
Stars
8
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Hi Marc,

When **Hall space group** is enabled (`SG%getuseHallSG() == .TRUE.`) **and** the crystal system implies **hexagonal sampling** (`usehex=.TRUE.`), the code derives pixel indices `(ipx, ipy)` from the **square Lambert** projection but later applies symmetry treating those indices as **hex Lambert** coordinates. The grid mismatch leaves regularly spaced pixels **unwritten**, which appear as a lattice of black pixels in the master pattern output.

### Proposed fix

```
if (SG%getuseHallSG().eqv..FALSE.) then
ipx = kij(1,ik)
ipy = kij(2,ik)
ipz = kij(3,ik)
else ! we are using the Hall space group symbols so extract (ipx, ipy, ipz) from unit k
! first transform to the Cartesian frame
call cell%TransSpace(karray(1:3,ik), kkk, 'r', 'c')
call cell%NormVec(kkk,'c')
L = Lambert_T( xyzd = kkk )
if (usehex) then
ierr = L%LambertSphereToHex(sxy)
else
ierr = L%LambertSphereToSquare(sxy)
end if
ipx = nint(sxy(1)*scl)
ipy = nint(sxy(2)*scl)
ipz = merge(1, -1, kkk(3) .ge. 0.0)
end if
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.