py4dstem / py4DSTEM

GNU General Public License v3.0
199 stars 135 forks source link

Fixes for the projected potential 2D function #666

Closed cophus closed 2 months ago

cophus commented 2 months ago

Certain unit cells, especially hexagonal cells, along some zone axis projection directions would attempt to tile an infinite number of times. Computers aren't good with infinity.

My fix was to instead of taking the 2 largest in-plane rotated unit cell lengths, take the 2 smallest out-of-plane lengths. This prevents the linear algebra degeneracy which led to the errors.