Skip to content

scattering/lattice-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lattice-calculator

PyPI version Python 3.7+ License: MIT

Performs lattice calculations for crystallography and neutron scattering, primarily for triple-axis spectrometers.

Installation

pip install icp-lattice-calculator

Usage

from lattice_calculator import Lattice, modvec, scalar, Orientation
import numpy as np

# Define a cubic lattice
lattice = Lattice(
    a=5.0, b=5.0, c=5.0,
    alpha=90, beta=90, gamma=90,
    orient1=np.array([[1, 0, 0]]),
    orient2=np.array([[0, 1, 0]])
)

# Calculate Q magnitude
q_mag = modvec(1, 0, 0, 'r', lattice)

Features

  • Crystal lattice definitions with arbitrary unit cells
  • Orientation matrix calculations
  • Conversion between reciprocal and real space
  • Vector operations (modvec, scalar, angle calculations)
  • Integration with rescalculator for TAS resolution

License

MIT

About

Performs lattice calculations --primarily for triple axis spectrometers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages