OpenHKL: data reduction for single crystal diffraction¶
About OpenHKL¶
What is OpenHKL?¶
OpenHKL is a GUI programme for data reduction of single crystal diffraction experiment data. It takes a series of detector images collected over a range of sample rotation angle increments and constructs a real space 3D model of the detector spots. This is used to determine an exhaustive list of reflections for sample unit cell, along with their Miller indices, integrated intensities and variances.
Why use OpenHKL?¶
There are many existing programmes that perform similar data reductions; many have been used extensively in the past and produce excellent results. However, OpenHKL is distinguished by a unique combination of important features.
Natively handles neutron diffraction¶
The OpenHKL project was started with the aim of developing a data reduction programme specifically for neutron diffraction, which is technically more problematic than X-ray diffraction in terms of data reduction. However, it can be used equally well for X-ray diffraction data.
Open source and fully documented¶
OpenHKL is fully open source, and none of its functionality is a “black box”. All algorithms are fully documented, such that users will no longer be left guessing as to what exactly OpenHKL does during the data reduction process. Modification and collaboration are encouraged, with the aim of improving OpenHKL as a community.
Easily extensible for different detector geometries¶
It is easy to extend OpenHKL to include different detector geometries; each
instrument is described a .yaml
machine file which contains the metadata and
physical setup.
Written in C++, with a Modern QT GUI¶
OpenHKL is written in C++ for excellent speed, using object-oriented principles to facilitate extensibility. It has a modern GUI, making it user friendly for the end user.
Core functionality available via Python API¶
All core functionality can be accessed via a Python scripting API, with the aim of facilitating i) automation of the data reduction process, and ii) systematic testing and optimisation of data reduction parameters.
History of OpenHKL¶
OpenHKL was started by Laurent Chapon and Eric Pellegrini at Institut Laue-Langevin in Grenoble under the name NSXTool (Neutron Single Xtal). It later became a collaboration between ILL and Forschungszentrum Jülich at the Heinz Maier-Leibnitz Zentrum (MLZ) in Garching. It was renamed to OpenHKL in 2022 to emphasise that it is intended also for X-ray diffraction as well as Neutron diffraction.
Installation guide¶
Compile from source¶
Install dependencies.
C++ compiler (e.g. g++, clang)
Python3
Cmake
QT5/6
Eigen3
GSL
HDF5
OpenGL
Tiff
QHull
YAMLCpp
FFTW3
Blosc
OpenCV
Swig
numpy
Optional dependencies:
OpenMP
Clone the git repository
git clone https://iffgit.fz-juelich.de/neutron-simlab/openhkl.git
Create a build directory, run
cmake
and compile the source:
cd openhkl
mkdir build
cd build
cmake ..
make -j8
make install <optional>
A SWIG-generated python module is installed to build/swig/pyohkl.py; in order to access OpenHKL libraries from a python script, it is necessary to either add the build/swig directory to your $PYTHONPATH variable, or add the following lines to your script.
import sys
sys.path.append("/path/to/build/swig")
import pyohkl as ohkl
- About OpenHKL
- Installation guide
- Tutorial
- Workflow
- Peak Table
- Rejection flags
- Detector image widget
- Show/hide peaks widget
- Integration
- Measures of Data Quality
- Theory
- Code Reference
RankedSolution
SolutionList
EquivalencePair
EquivalenceList
sptrProgressHandler
InstrumentStateList
sptrPeak3D
PeakList
sptrPeakList
sptrShapeModel
RejectionFlag
PeakCollectionType
PeakInterpolation
PeakHistogramType
log()
Refiner()
reconstructBatches()
refineUB()
refineDetectorOffset()
refineSamplePosition()
refineSampleOrientation()
refineKi()
refine()
updatePredictions()
batches()
unrefinedCell()
refinedStates()
unrefinedStates()
nframes()
firstRefine()
logChange()
parameters()
setParameters()
assignPredictedCells()
makeBatches()
_getUnitCell()
ExperimentYAML()
ExperimentYAML()
grabDataReaderParameters()
setDataReaderParameters()
grabIntegrationParameters()
setIntegrationParameters()
grabPeakFinderParameters()
setPeakFinderParameters()
grabAutoindexerParameters()
setAutoindexerParameters()
grabShapeParameters()
setShapeParameters()
grabPredictorParameters()
setPredictorParameters()
grabMergeParameters()
setMergeParameters()
writeFile()
getNode()
operator<<()
refine_ub
refine_ki
refine_sample_position
refine_sample_orientation
refine_detector_offset
nbatches
residual_type
max_iter
use_batch_cells
set_unit_cell
_cell_handler
_unrefined_cell
_unrefined_states
_cell
_batch_cells
_batches
_nframes
_first_refine
_states
_params
_eps_norm
_tmp_vec
_peaks
_node
IndexerParameters
AutoIndexer
RefinerParameters
Refiner
DataSet
ImageGradient
SingleFrame
Experiment
ExperimentYAML
Integrator
PeakFinderParameters
PeakFinder
PeakFinder2DParameters
PeakFinder2D
ShapeModelBuilder
Diffractometer
InstrumentState
InstrumentStateSet
InterpolatedState
Blob3D
GaussianIntegrator
ComputeResult
IntegrationParameters
IIntegrator
ISigmaIntegrator
PixelSumIntegrator
Profile1DIntegrator
Profile3DIntegrator
ShapeIntegrator
Peak3D
KeyPointCollection
PeakCollection
PeakFilterFlags
PeakFilterParameters
PeakFilter
PredictionParameters
StrategyParameters
Predictor
Profile
Profile1D
Profile3D
ShapeModelParameters
ShapeModel
MergeParameters
PeakMerger
PeakStatistics
- Authors