aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/man/pattern_sim.116
-rw-r--r--src/pattern_sim.c37
2 files changed, 11 insertions, 42 deletions
diff --git a/doc/man/pattern_sim.1 b/doc/man/pattern_sim.1
index 02854040..36287162 100644
--- a/doc/man/pattern_sim.1
+++ b/doc/man/pattern_sim.1
@@ -27,6 +27,8 @@ pattern_sim -g mydetector.geom -p my.pdb -r -i myintensities.hkl
The unit cell geometry will be taken from the unit cell 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 a geometry description file (-g). 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.
+Set the incident radiation wavelength and bandwidth in the geometry file. Beam divergence is not taken into account. See \fBman crystfel_geometry\fR for information about CrystFEL geometry description files.
+
The result will be written to an HDF5 file in the current directory with the name `sim.h5'.
.SH OPTIONS
@@ -140,20 +142,6 @@ Suppress the subsidiary maxima of the shape transforms by setting I_latt(q) to z
.PD 0
.B
-.IP "\fB--beam-bandwidth=\fIval\fR"
-.PD
-Set the bandwidth, expressed as a decimal fraction applying to to wavelengths (not the photon energies), for the incident beam. The default is \fB--beam-bandwidth=0.01\fR, i.e. 1%.\fR.
-.PD
-Note: When using the two-colour or SASE spectrum, the spectrum calculation actually takes this value to be the bandwidth applying to the photon energies instead of the wavelengths. For small bandwidths, the difference should be very small. Sorry for the horrifying inconsistency.
-
-.PD 0
-.B
-.IP "\fB--photon-energy=\fIval\fR"
-.PD
-Set the central photon energy, in eV, for the incident beam. The default is \fB--photon-energy=9000\fR, i.e. 9 keV X-rays.
-
-.PD 0
-.B
.IP "\fB--nphotons=\fIval\fR"
.PD
Set the number of photons per X-ray pulse. The default is \fB--nphotons=1e12\fR. A physically reasonable value is such that the pulse energy (number of photons multiplied by photon energy) is about 1 mJ.
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 891d39a7..9769a0d4 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -104,13 +104,10 @@ static void show_help(const char *s)
" --template=<file> Take orientations from stream <file>.\n"
" --no-fringes Exclude the side maxima of Bragg peaks.\n"
" --flat Make Bragg peaks flat.\n"
-" --beam-bandwidth Beam bandwidth (standard deviation of wavelength as\n"
-" a fraction of wavelenth). Default 0.001 (1%%)\n"
" --sase-spike-width SASE spike width (standard deviation in m^-1)\n"
" Default 2e6 m^-1\n"
" --twocol-separation Separation between peaks in two-colour mode in m^-1\n"
" Default 8e6 m^-1\n"
-" --photon-energy Photon energy in eV. Default 9000.\n"
" --nphotons Number of photons per X-ray pulse. Default 1e12.\n"
" --beam-radius Radius of beam in metres (default 1e-6).\n"
);
@@ -513,8 +510,6 @@ int main(int argc, char *argv[])
int flat = 0;
double nphotons = 1e12;
double beam_radius = 1e-6; /* metres */
- double bandwidth = 0.01;
- double photon_energy = 9000.0;
double sase_spike_width = 2e6; /* m^-1 */
double twocol_sep = 8e6; /* m^-1 */
@@ -670,28 +665,14 @@ int main(int argc, char *argv[])
break;
case 7 :
- bandwidth = strtod(optarg, &rval);
- if ( *rval != '\0' ) {
- ERROR("Invalid beam bandwidth.\n");
- return 1;
- }
- if ( bandwidth < 0.0 ) {
- ERROR("Beam bandwidth must be positive.\n");
- return 1;
- }
- break;
+ ERROR("--beam-bandwidth is no longer used.\n");
+ ERROR("Set the bandwidth in the geometry file instead.\n");
+ return 1;
case 9 :
- photon_energy = strtod(optarg, &rval);
- if ( *rval != '\0' ) {
- ERROR("Invalid photon energy.\n");
- return 1;
- }
- if ( photon_energy < 0.0 ) {
- ERROR("Photon energy must be positive.\n");
- return 1;
- }
- break;
+ ERROR("--photon-energy is no longer used.\n");
+ ERROR("Set the photon energy in the geometry file instead.\n");
+ return 1;
case 10 :
nphotons = strtod(optarg, &rval);
@@ -939,8 +920,7 @@ int main(int argc, char *argv[])
image->lambda*1e10,
ph_lambda_to_eV(image->lambda));
STATUS(" Number of photons: %.0f (%.2f mJ)\n",
- nphotons,
- eV_to_J(photon_energy)*nphotons*1e3);
+ nphotons, eV_to_J(ph_lambda_to_eV(image->lambda))*nphotons*1e3);
STATUS(" Beam divergence: not simulated\n");
STATUS(" Beam radius: %.2f microns\n",
beam_radius*1e6);
@@ -965,7 +945,8 @@ int main(int argc, char *argv[])
case SPECTRUM_TWOCOLOUR:
STATUS(" X-ray spectrum: two colour, "
- "separation %.5f %%\n", image->bw*100.0);
+ "bandwidth %.5f %%, separation %.5e m^-1\n",
+ image->bw*100.0, twocol_sep);
break;
case SPECTRUM_FROMFILE: