This project consists of two packages - convergent beam simulation program (cbc) and experimental data processing package (cbc_dp)
Simulation for convergent beam diffration on a crystalline sample written in Python. Code is compatible with Python 2.X and 3.X.
For more information regarding the theory behind this see the article written by Prof. Henry Chapman.
It's a package called cbc, with which you can conduct a diffraction simulation. See usage examples: go to cbc package structure
Required dependencies:
- NumPy
- Numba
- SciPy
- matplotlib
- h5py
The package can perform convergent beam diffraction simulation of crystalline samples based on first Born approximation theory.
Available incoming beam models:
- Gaussian beam
- Bessel beam
- Lens beam with rectangular or circular aperture
Samples could be composed of different compound unit cells deffined by array of atom coordinates within the unit cell and corresponding B-factors. These data can be imported via PDB format file. Unit cells are arranged in a rectangular grid.
The library itself consists of two modules and an utility package:
- beam.py - a module with incoming beam classes
- lattice.py - a module with sample lattice classes
- wrapper.py - simulation calculation wrapper module
- utils - utility package:
- utilfuncs.py - utility functions for convergent beam diffraction project
- asf - atomic scattering factor calculation package:
- load.py - a module, that loads atomic scattering factor fit coefficients
- pdb - PDB data import package
- readpdb.py - a module, that imports molecular structure .pdb files
Also there is a couple of usage examples:
- read.py - reading and ploting diffraction results
- diff_run.py - diffraction simulation example
- consider different crystall space groups
Experimental convergent diffraction data processing package. Data is acquired from PETRA P06 beamtime on June 13, 2019.
- Flatfield correction
- Median filtering
- Non maximum supression
- Progressive Probabilistic Hough line transform
- Line Segment Detector (LSD)
More information about Progressive Hough transform is written in this article and about Line Segment Detector in this article.
- Rotational diffraction pattern indexing
- Convergent beam indexer