A selection of example scripts for performing different actions using the functions of Dans_Diffraction.
To run a script, run the scripts from a terminal or your preferred python method.
For example, run the following from a terminal navigated to the examples folder:
$ cd Dans_Diffraction/Examples
$ ipython ./example_reflections.py
When running plot commands or using the GUI, initialising with interactive mode and a matplotlib backend helps:
$ ipython -i --matplotlib tk ./example_plot_powder.py
Filename | Description |
---|---|
example_build_crystal.py | Build your very own crystal structure, using lattice parameters and atomic coordinates |
example_calculate_intensities.py | Calculate list of reflections using different methods Makes use of the new scattering functionality in Dans_Diffraction 2.0.0+ Requires Dans_Diffraction version >2.0.0 |
example_cell_basis.py | Select different cell basis options, requires Dans_Diffraction >V3.3 |
example_cell_sliders.py | Plot different cell basis options, requires Dans_Diffraction >V3.3 |
example_coherent_diffraction.py | Simulate coherent diffraction by creating a large crystallite of many unit cells. Use one of two methods to define a random crystallite shape: 1. random distribution of cells around a central point - cells are not always neighboring but creates a nice ellipsoid 2. random walk of cells - each cell has a direct neighbor but the shapes can be very odd Requires Dans_Diffraction version >2.0.0 |
example_complex_neutron_scattering.py | Calculate neutron scattering from isotopes using complex neutron scattering lengths |
example_crysalispro_cuts.py | Example Read recirpocal space cuts from CrysAlisPro |
example_crystal_orientation.py | Set and change the orientation of the crystal Makes use of the new orientation functionality in Dans_Diffraction 2.1.0+ Requires Dans_Diffraction version >2.1.0 |
example_cxro.py | Simulate the functionality of the CXRO website: https://henke.lbl.gov/optical_constants/ Use formulas from: B.L. Henke, E.M. Gullikson, and J.C. Davis, X-ray interactions: photoabsorption, scattering, transmission, and reflection at E=50-30000 eV, Z=1-92, Atomic Data and Nuclear Data Tables 54 no.2, 181-342 (July 1993). |
example_dac_reflections.py | Calculate list of reflections in a pressure cell with limited opening window. |
example_diffraction_detector.py | Calcualte number of peaks possible on a high angle detector |
example_electron_diffraction.py | Calculate diffraction using electron form factors |
example_exchange_path.py | Calculate exchange path between magnetic atoms |
example_fdmnes.py | Create FDMNES files, run program and plot results |
example_fdmnes_analysis.py | Analyse FDMNES results |
example_fdmnes_multifile.py | Create FDMNES files, run program and plot results |
example_generate_powder.py | Generate powder spectrum from a cif file |
example_generate_powder_custom_profile.py | Generate powder spectrum from a cif file with a custom peak profile Requires: lmfit |
example_gui.py | Example python file creating GUI using Dans_Diffraction |
example_intensity_comparison.py | Compare calcualted reflection intensities for a CIF between different software |
example_large structure_calculation.py | Simulate a powder diffraction pattern from a large structrue |
example_latex_table.py | Calculate list of reflections |
example_magnetic_cif.py | Calculate list of reflections |
example_magnetic_spacegroup.py | Check magnetic space groups |
example_magnetic_structure.py | Calculate list of reflections |
example_magnetic_subgroups.py | Check magnetic space groups Use https://www.cryst.ehu.es/cgi-bin/cryst/programs/msglist2.pl 1. Load Crystal structure 2. Submit crystal spacegroup and propagation vector to MAXMAGN 3. Get list of Magnetic space groups & transformations, download "Parent-like setting" General positions 4. Generate new crystal structure using propagation vector and general position symmetry 4. Apply magnetic symmetry |
example_magnetic_symmetry.py | Load space groups and look at the information contained. |
example_multicrystal.py | Calculate list of reflections |
example_multiple_scattering.py | Run multiple scattering calculations |
example_orbitals.py | Display atomic orbitals |
example_orient_reflection.py | Set and change the orientation of the crystal Makes use of the new orientation functionality in Dans_Diffraction 2.1.0+ Requires Dans_Diffraction version >2.1.0 |
example_plot_powder.py | Plot powder pattern from a crystal |
example_plot_reciprocalspace.py | Generate a plane in reciprocal space |
example_read_cif.py | Read values from a Crystallographic Information File (.cif or .mcif) |
example_reflections.py | Calculate list of reflections |
example_reflections_to_powder.py | Turn a reflection list from single crystal experiment to a powder pattern |
example_resonant_scattering.py | Calculate list of reflections |
example_spacegroups.py | Load space groups and look at the information contained. |
example_supercell.py | Build a supercell from multiple unit cells and simulate the diffraction pattern |
example_supercell_plotlayers.py | Build a supercell from multiple unit cells and plot the layers |
example_supercell_powder.py | Calculate supercell diffraction pattern and convert planes to a powder pattern This is not equivalent to simulating the powder pattern of a supercell as symmetry domains are not considered in the powder simulation. |
example_tensor_scattering.py | Run multiple scattering calculations |
example_write_cif.py | Read values from a Crystallographic Information File (.cif or .mcif), edit the structure, write a different file |
example_write_mcif.py | Read values from a Crystallographic Information File (.cif or .mcif), edit the structure, write a different file |
example_xray_dispersion.py | Calculate reflection intensity with x-ray resonant dispersion corrections |