aboutsummaryrefslogtreecommitdiff
path: root/julia/CrystFEL
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-05-13 17:02:50 +0200
committerThomas White <taw@physics.org>2024-05-13 17:02:50 +0200
commit77649b7aee5cef8fc0a6bd26a2f58f513db52367 (patch)
tree67487be60b3cbe6e1ee97e95248ee2ab9189c34a /julia/CrystFEL
parent741ca70b8fae1ca560fa84b7a533efbd7f2ba1de (diff)
Julia: Add basic wrapper for compare_reindexed_cell_parameters
Diffstat (limited to 'julia/CrystFEL')
-rw-r--r--julia/CrystFEL/src/CrystFEL.jl2
-rw-r--r--julia/CrystFEL/src/cell.jl18
2 files changed, 18 insertions, 2 deletions
diff --git a/julia/CrystFEL/src/CrystFEL.jl b/julia/CrystFEL/src/CrystFEL.jl
index 7aa5b5fe..9ab5d15f 100644
--- a/julia/CrystFEL/src/CrystFEL.jl
+++ b/julia/CrystFEL/src/CrystFEL.jl
@@ -34,7 +34,7 @@ export TetragonalLattice, HexagonalLattice, RhombohedralLattice, CubicLattice
export PrimitiveCell, ACenteredCell, BCenteredCell, CCenteredCell
export BodyCenteredCell, FaceCenteredCell, RhombohedralCell, RhombohedralCellOnHexagonalAxes
export NoUniqueAxis, UnknownUniqueAxis, UniqueAxisA, UniqueAxisB, UniqueAxisC
-export rotatecell
+export rotatecell, compare_reindexed_cell_parameters
include("detgeom.jl")
using .DetGeoms
diff --git a/julia/CrystFEL/src/cell.jl b/julia/CrystFEL/src/cell.jl
index a18810bb..d8e72799 100644
--- a/julia/CrystFEL/src/cell.jl
+++ b/julia/CrystFEL/src/cell.jl
@@ -10,7 +10,7 @@ export TetragonalLattice, HexagonalLattice, RhombohedralLattice, CubicLattice
export PrimitiveCell, ACenteredCell, BCenteredCell, CCenteredCell
export BodyCenteredCell, FaceCenteredCell, RhombohedralCell, RhombohedralCellOnHexagonalAxes
export NoUniqueAxis, UnknownUniqueAxis, UniqueAxisA, UniqueAxisB, UniqueAxisC
-export rotatecell
+export rotatecell, compare_reindexed_cell_parameters
# Represents the real C-side (opaque) structure.
@@ -427,4 +427,20 @@ Equivalent to CrystFEL routine `cell_rotate(uc, random_quaternion(<rng>))`.
rotatecell(uc) = rotatecell(uc, randomquat())
+"""
+ compare_reindexed_cell_parameters(uc, reference, tols)
+
+"""
+function compare_reindexed_cell_parameters(uc, reference, tols)
+ out = @ccall libcrystfel.compare_reindexed_cell_parameters(uc.internalptr::Ptr{InternalUnitCell},
+ reference.internalptr::Ptr{InternalUnitCell},
+ collect(Cdouble,tols)::Ptr{Cdouble},
+ C_NULL::Ptr{Cvoid})::Ptr{InternalUnitCell}
+ if out == C_NULL
+ throw(ErrorException("Cell comparison failed"))
+ end
+ UnitCell(out)
+end
+
+
end # of module