partial_sim: calculate partial reflections


partial_sim -o -g geometry.geom -p unitcell.pdb [options] ...
partial_sim --help


partial_sim calculates the intensities of idealised partial reflections from crystals in random orientations, which is useful for testing the convergence of Monte Carlo integration or scaling/post-refinement techniques.

You need to provide a CrystFEL geometry file (with --geometry=my.geom or -g my.geom), a file containing the unit cell to use for the simulation (with --pdb=my.pdb or -p my.pdb), and an output filename with or -o

For each randomly generated orientation, partial_sim calculates which reflections would appear on the detector with the specified beam parameters. It calculates the partiality for each reflection and multiplies it by the fully integrated intensity to produce a partial intensity. The fully integrated intensities can be taken from a file you provide (see below), otherwise they will be randomly generated (by taking the absolute value of a Gaussian random number, mean zero and standard deviation 1000). All the partial intensities for the orientation are multiplied by an overall scaling factor, which is randomly generated with a Gaussian distribution with mean 1 and standard deviation 0.3. The partial intensities are written to the output stream, and the process repeated for as many different orientations as you ask for (see below, default: 2).

See man crystfel_geometry for information about CrystFEL geometry description files.


-i file.hkl
Take the fully integrated reflection intensities from file.hkl, instead of generating them randomly.
-n n
Specify the number of different orientations to simulate. Default: 2.
-p unitcell.cell
-p unitcell.pdb

Specify the name of the file containing the unit cell information, in PDB or CrystFEL format.

-r random.hkl
If you did not provide your own fully integrated reflection intensities, they will be generated randomly for you. Use this option to save the random intensities for future comparisons.
-y pointgroup
When combined with with -i, specifies the symmetry of the input reflection list. Otherwise, specifies the symmetry of the randomly generated intensities.
-c val
Add random values with a flat distribution to the components of the reciprocal lattice vectors written to the stream, simulating indexing errors. The maximum value that will be added is +/- val percent.
Save a table of values to filename containing, in resolution shells, the following columns: resolution shell centre in nm-1, number of reflections in shell, mean partiality, maximum partiality.
Set the standard deviation of the distribution of overall scaling factors to val. The distribution will be cut at zero, i.e. negative or zero scaling factors are not allowed. The distribution will be Gaussian centered on 1. The default is --osf-stddev=2.0.
Set the standard deviation of the distribution of randomly generated full intensities to val. The distribution will be Gaussian, centered on zero, and the absolute value will be taken (i.e. there will be no negative values). The default is --full-stddev=1000.0. This option has no effect if you also use -i or --input.
Set the standard deviation of the noise added to the partial intensities to val. The noise will be Gaussian, and the same for all reflections. The default is --noise-stddev=20.0.
-j n
Use n threads for simulation. Default: 1.
For each chunk in the output stream, write an image in HDF5 format to prefix/sim-NNN.h5, where NNN is the sequence number of the chunk in the output stream. This option is incompatible with -j. The intensities in the peaks in the sketches will be equal to the partial intensities in the stream, including noise and overall scaling factors. The images will also contain a random Poisson-distributed background according to --background.
Add a Poisson-distributed background with val photons to the sketches (see --images). The default is --background=3000.
Set the convergence angle (the full angle, not "half-angle"/"semi-angle") for the incident beam. The default is --beam-divergence=0.001, i.e. 1 mrad.
Set the bandwidth, expressed as a decimal fraction applying to to wavelengths (not the photon energies), for the incident beam. The default is --beam-bandwidth=0.01, i.e. 1%.
Set the radius of the scattering density surrounding each reciprocal lattice point, in m^-1. The default is --profile-radius=0.001e9 m-1.
Set the central photon energy, in eV, for the incident beam. The default is --photon-energy=9000, i.e. 9 keV X-rays.
Seed the random number generator using the kernel random number generator (/dev/urandom). This means that truly random (although not "cryptographically random") numbers will be used for the orientation and crystal size, instead of the same sequence being used for each new run.
Get the crystal cell parameters, orientations and the reflections to calculate from This allows you to re-calculate partial intensities using new beam parameters. There must only be one crystal per chunk in the template. If more than one thread is used (see -j), note that there is no guarantee that the order of crystals in the output stream will match that of


This page was written by Thomas White.

Reporting bugs

Report bugs to

Copyright and Disclaimer

Copyright © 2012-2020 Deutsches Elektronen-Synchrotron DESY, a research centre of the Helmholtz Association.

Please read the AUTHORS file in the CrystFEL source code distribution for a full list of contributions and contributors.

CrystFEL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CrystFEL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CrystFEL. If not, see

See also

crystfel process_hkl partialator pattern_sim crystfel_geometry

If CrystFEL is installed on your computer, you can read this manual page offline using the command man partial_sim.