forked from edocappelli/crystalpy
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
72,132 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
============================================================== | ||
Test of test Scherrer equation vs dynamical diffracion results | ||
============================================================== | ||
|
||
The dynamical diffraction profile is calculated for several cases of hkl reflections and crystal thickness, and | ||
the results are compared with the Scherrer equation for two crystals LaB6 and Tripalmitin. | ||
|
||
---- | ||
LaB6 | ||
---- | ||
|
||
For LaB6 the results are calculated using the scripts: | ||
|
||
- scherrer_LaB6.py : comparison as a function of 2theta. | ||
|
||
.. image:: ./scherrer_LaB6.png | ||
|
||
- scherrer_vs_xtal_thickness_LaB6.py : comparison vs crystal thickness. | ||
|
||
.. image:: ./scherrer_vs_xtal_thickness_LaB6.png | ||
|
||
----------- | ||
Tripalmitin | ||
----------- | ||
|
||
Tripalmitin crystal is not available in the standard crystalpy material libraries (xraylib and dabax). | ||
To include it, a new entry has been created in the dabax data file ./dabax/Crystals.dat, that is used for calculations | ||
in the scripts | ||
|
||
- scherrer_Tripalmitin.py : comparison as a function of 2theta. | ||
|
||
.. image:: ./scherrer_Tripalmitin.png | ||
|
||
- scherrer_vs_xtal_thickness_tripalmitin.py : comparison vs crystal thickness. | ||
|
||
.. image:: ./scherrer_vs_xtal_thickness_Tripalmitin.png | ||
|
||
This new entry in dabax has been created: | ||
|
||
- using the cif file from: https://www.ccdc.cam.ac.uk/structures/Search?Compound=tripalmitin&DatabaseToSearch=Published | ||
|
||
- calculating the 1x1x1 supercell using cif2cell (files here: https://github.com/srio/shadow3-scripts/tree/master/cif131755 ) | ||
|
||
- copying this structure to Crystals.dat | ||
|
||
The selected [intense] reflections are obtained making a powder diffraction simulation runing oasys/powder with the cif | ||
file (files: https://github.com/srio/shadow3-scripts/tree/master/cif131755 ). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# crystal tests | ||
# | ||
import numpy | ||
from dabax.dabax_xraylib import DabaxXraylib | ||
|
||
dx = DabaxXraylib(dabax_repository='./dabax/') | ||
print(dx.info()) | ||
# dx.set_verbose() | ||
|
||
print("DABAX crystal list: \n", dx.Crystal_GetCrystalsList()) | ||
|
||
crystal = 'Tripalmitin' | ||
siD = dx.Crystal_GetCrystal(crystal) | ||
|
||
print("DABAX crystal: \n", siD) | ||
|
||
print("%s 111 d-spacing: DABAX: %g" % \ | ||
(crystal, dx.Crystal_dSpacing(siD, 1, 1, 1))) | ||
|
||
print("%s 111 bragg angle at 10 keV [deg]: DABAX: %g" % ( crystal, \ | ||
180 / numpy.pi * dx.Bragg_angle(siD, 10, 1, 1, 1), )) | ||
|
||
# F0 = dx.Crystal_F_H_StructureFactor(siD,8.0,0,0,0,1.0,ratio_theta_thetaB=1.0) | ||
dabax_all_F = dx.Crystal_F_0_F_H_F_H_bar_StructureFactor(siD, 8.0, 1, 1, 1, 1.0, rel_angle=1.0) | ||
|
||
print("F0 dabax: ", | ||
dx.Crystal_F_H_StructureFactor(siD, 8.0, 0, 0, 0, 1.0, 1.0), dabax_all_F[0], | ||
) | ||
|
||
print("F111 dabax: ", | ||
dx.Crystal_F_H_StructureFactor(siD, 8.1, 1, 1, 1, 1.0, 1.0), dabax_all_F[1], | ||
) | ||
|
||
print("F-1-1-1 dabax: ", | ||
dx.Crystal_F_H_StructureFactor(siD, 8.1, -1, -1, -1, 1.0, 1.0), dabax_all_F[2], | ||
) | ||
|
||
print("F001 dabax F2: ", numpy.abs(dx.Crystal_F_H_StructureFactor(siD, 8.1, 0, 0, 1, 1.0, 1.0))**2) | ||
print("F002 dabax F2: ", numpy.abs(dx.Crystal_F_H_StructureFactor(siD, 8.1, 0, 0, 2, 1.0, 1.0))**2) | ||
print("F003 dabax F2: ", numpy.abs(dx.Crystal_F_H_StructureFactor(siD, 8.1, 0, 0, 3, 1.0, 1.0))**2) |
Oops, something went wrong.