aboutsummaryrefslogtreecommitdiff
path: root/doc/man/pattern_sim.1
blob: e4e6bea5751bfafb8ad8ef2287981137480df438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.\"
.\" pattern_sim man page
.\"
.\" Copyright © 2012 Thomas White <taw@physics.org>
.\"
.\" Part of CrystFEL - crystallography with a FEL
.\"

.TH PATTERN_SIM 1
.SH NAME
pattern_sim \- Simulation of nanocrystal diffraction patterns
.SH SYNOPSIS
.PP
.B pattern_sim
\fB-g\fR \fIdetector.geom\fR \fB-b\fR \fImy.beam\fR \fB-p\fR \fImy.pdb\fR
[\fBoptions\fR] \fB...\fR
.PP
.B pattern_sim
\fB--help\fR

.SH DESCRIPTION

pattern_sim simulates diffraction patterns from small crystals probed with femtosecond pulses of X-rays from a free electron laser.  Typical use might be of the form:

pattern_sim -g mydetector.geom -b my.beam -p my.pdb -r -i myintensities.hkl

The unit cell geometry will be taken from the CRYST1 line in the PDB file you provide, and the intensities of the reflections will be interpolated from the reflection list file you provide.  The reflection list format is the same as that output by process_hkl and handled by get_hkl.  You also need beam and geometry description files (-b and -g respectively).  See `man crystfel_geometry' for details of how to create a geometry file.  Examples of both files can be found in the installation directory, which is normally /usr/local/share/doc/crystfel.

The result will be written to an HDF5 file in the current directory with the name `sim.h5'.

.SH OPTIONS


.SH REFLECTION LISTS

You'll need to create a file containing the intensities of the reflections.  The normal way to do this is to use CCP4 via the "gen-sfs" script in CrystFEL's script folder.  Run it like this:

$ \fBgen-sfs\fR \fImymodel.pdb\fR \fB"\fR\fIP6\fR\fB"\fR \fI3\fR

You need to give the PDB model, the symmetry of the output reflections (use the lowest symmetry space group with the right point group), and optionally the maximum resolution in Angstroms.  If you don't specify the resolution, it'll use 3 Angstroms.

The reflections will be output as \fImymodel.pdb\fR.hkl ready for input to pattern_sim.  You'll need to give the Laue class of the symmetry you gave to gen-sfs, "6/m" in this case, to pattern_sim with \fB-y\fR.  By default, \fBgen-sfs\fR calculates the values for CuKa radiation (8.3 keV, 1.5 A).  It will not calculate the anomalous contribution to scattering, i.e. the differences in intensities between Bijoet pairs.  Both of these are the default behaviour for "sfall" in CCP4, so read the manual for that for further details.  If you need something different, get the "ano_sfall.com" script from James Holton and use the
\fBgen-sfs-ano\fR script instead of \fBgen-sfs\fR.

.SH CALCULATION DETAILS

The lattice transform from the specified number of unit cells is calculated
using the closed-form solution for a truncated lattice faceted on the
(001), (010) and (100) planes:
.IP
I_latt(q) =  sin^2(pi*na*g.a)/sin^2(pi*g.a)
           * sin^2(pi*nb*g.b)/sin^2(pi*g.b)
           * sin^2(pi*nc*g.c)/sin^2(pi*g.c)
.IP
na = number of unit cells in 'a' direction (likewise nb, nc)
.br
 g = reciprocal vector (1/d convention, not 2pi/d)
.PP
This is multiplied by a model of the underlying molecular transform, I_mol(g).
This can be approximated to varying levels of accuracy by the methods given by
\fB--gradients\fR.
.PP
Expected intensities at the CCD are then calculated using:
.IP
I(g) = I0 * r^2 * I_latt(g) * I_mol(g) * S
.IP
I0 = number of photons per unit area in the incident beam
 r = Thomson radius
 S = solid angle of corresponding pixel
.PP
Polarisation is not currently included in pattern_sim, although it is included
in the analysis of Bragg peaks done by \fBindexamajig\fR.
.PP
Poisson counts are generated from the expected intensities using Knuth's
algorithm.  When the intensity is sufficiently high that Knuth's algorithm
would result in machine precision problems, a normal distribution with
standard deviation sqrt(I) is used instead.

.SH AUTHOR
This page was written by Thomas White.

.SH REPORTING BUGS
Report bugs to <taw@physics.org>, or visit <http://www.desy.de/~twhite/crystfel>.

.SH COPYRIGHT AND DISCLAIMER
Copyright © 2012 Thomas White <taw@physics.org>
.P
pattern_sim is part of CrystFEL.
.P
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.
.P
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.
.P
You should have received a copy of the GNU General Public License along with CrystFEL.  If not, see <http://www.gnu.org/licenses/>.

.SH SEE ALSO
.BR crystfel (7)
and
.BR crystfel_geometry (5).