throughput¶
author: | Stanislav Stoupin |
---|---|
email: | <sstoupin@gmail.com> |
calculate throughput of a multicrystal configuration (dynamical theory of x-ray diffraction for perfect crystals)
SYNOPSIS¶
throughput [options] func dpsi Ec dEx ne input_file
DESCRIPTION¶
A program to calculate throughput of a multicrystal configuration given by input_file using dynamical theory of x-ray diffraction for perfect crystals For a brief summary of options and parameters run:
throughput -h
PARAMETERS¶
func: | angular divergence distribution function for incoming x-rays:
|
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dpsi: | angular divergence in units of [urad]
|
|||||||||||||||
Ec: | central energy for energy distribution in units of [keV] (corrected automatically depending on the choice of source and presence of crystals in backscattering configuration in the input file) |
|||||||||||||||
dEx: | energy half-range in units of [meV] |
|||||||||||||||
ne: | number of points in the energy grid (max 1000) |
OPTIONS¶
-v, --version: | show version of program. |
||||||||
---|---|---|---|---|---|---|---|---|---|
-h, --help: | show summary of options. |
||||||||
-o FILENAME, --output FILENAME: | |||||||||
write results to file (default to stdout) |
|||||||||
-w FILENAME, --write FILENAME: | |||||||||
write data to file (default - no action) |
|||||||||
-p, --pi: | \(\pi\) polarization for incident wave (default - \(\sigma\) polarization) |
||||||||
-a NTH, --angular_scan NTH: | |||||||||
perform crystal rotation (angular scan) with NTH points |
|||||||||
-s SRC, --source SRC: | |||||||||
type of energy distribution for the source:
A point source is assumed. Source size is not included to the calculation at the moment. For throughput calculation the source size can be modeled as additional divergence. |
|||||||||
-n NPSI, --npsi NPSI: | |||||||||
number of points in the angular grid (default NPSI=200) |
EXAMPLES¶
- Throughput (intensity as function of photon energy) of a multicrystal configuration (double-crystal diamond monochromator)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Crystal input file for throughput program
# Author: Stanislav Stoupin <sstoupin@aps.anl.gov> 2014
#################################################################################################################
# Example: calculation of throughput of a double-crystal C (diamond) high-heat-load monochromator
# to perform calculation for incident beam with Gaussian divergence of 5 urad rms at 23.7 keV
# in the photon energy range from -5000 meV to 5000 meV with 250 steps run:
# throughput g 5 23.7 5000 250 thru_hhlmC.in
#################################################################################################################
# columns:
# element h k l eta[deg] phi[deg] T[K] dc[mm] sign(+counterclockwise,-clockwise) R/T entity exactbb(1true,0false)
# offset[urad] angular_scan(0,1,2) angular_increment[urad]
## CDDW #########################################################################################################
C 1 1 1 0 0 350 0.3 1 R 1 0 0 0 0
C 1 1 1 0 0 300 0.5 -1 R 2 0 0 0 0
|
To perform the calculation
throughput g 5 23.7 5000 250 thru_hhlmC.in
- Calculation of a rocking curve in a multicrystal configuration (the same double-crystal diamond monochromator, rocking curve of the 2nd crystal).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Crystal input file for throughput program
# Author: Stanislav Stoupin <sstoupin@aps.anl.gov> 2014
#################################################################################################################
# Example: calculation of rocking curve of the second crystal of a double-crystal C (diamond) high-heat-load monochromator
# to perform calculation for an incident beam with a Gaussian divergence of 5 urad rms at 23.7 keV
# in the photon energy range from -5000 meV to 5000 meV with 250 steps,
# with angular scan of 100 points (with angular increment being the last parameter in the second line)
# and save data into a file "c2rc_hhlmC_23keV.dat" run the following:
# throughput -a 100 -w c2rc_hhlmC_23keV.dat g 5 23.7 5000 250 c2rc_hhlmC.in
#################################################################################################################
# columns:
# element h k l eta[deg] phi[deg] T[K] dc[mm] sign(+counterclockwise,-clockwise) R/T entity exactbb(1true,0false)
# offset[urad] angular_scan(0,1,2) angular_increment[urad]
## CDDW #########################################################################################################
C 1 1 1 0 0 350 0.3 1 R 1 0 0 0 0
C 1 1 1 0 0 300 0.5 -1 R 2 0 0 1 0.5
|
The code is not vectorized at present, calculations can take from a few minutes to a few hours. The progress of the rocking curve calculation is displayed interactively (the plot is updated as each additional point is calculated). Hint: prior to full simulation using divergent x-rays ("g", "l", or "f"), try quick estimation using single ray ("1r")
throughput -a 100 -w c2rc_hhlmC_23keV.dat 1r 0 23.7 5000 250 c2rc_hhlmC.in
To perform the full calculation using divergent (Gaussian) beam
throughput -a 100 -w c2rc_hhlmC_23keV.dat g 5 23.7 5000 250 c2rc_hhlmC.in