Source code for coseda.crystfel_cell

"""CrystFEL unit-cell naming helpers."""

CRYSTFEL_LATTICE_TYPES = [
    "triclinic",
    "monoclinic",
    "orthorhombic",
    "tetragonal",
    "rhombohedral",
    "hexagonal",
    "cubic",
]
UNIQUE_AXIS_LATTICE_TYPES = {"monoclinic", "tetragonal", "hexagonal"}


[docs] def normalize_crystfel_lattice_type(lattice_type, centering=""): """Return a CrystFEL-accepted lattice_type value.""" lattice_type = str(lattice_type or "").strip().lower() if lattice_type == "trigonal": return "hexagonal" return lattice_type
[docs] def crystfel_unique_axis_allowed(lattice_type): """Return whether CrystFEL accepts unique_axis for this lattice type.""" return normalize_crystfel_lattice_type(lattice_type) in UNIQUE_AXIS_LATTICE_TYPES