aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-05-24 19:47:50 +0200
committerThomas White <taw@physics.org>2019-05-29 10:42:14 +0200
commit69bd3f54c651980d39e2d38694f2032aaca44d16 (patch)
treeccdcc6b4b0a1bd21ac292a610c53e853bcf350af /libcrystfel
parent0e1726e01645c110e9935cc8c3e8f35291b2b82d (diff)
Fix SASE simulation
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/spectrum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcrystfel/src/spectrum.c b/libcrystfel/src/spectrum.c
index 5cb5c47d..a1b1c899 100644
--- a/libcrystfel/src/spectrum.c
+++ b/libcrystfel/src/spectrum.c
@@ -535,9 +535,9 @@ Spectrum *spectrum_generate_sase(double wavelength, double bandwidth,
if ( s == NULL ) return NULL;
for ( i=0; i<15; i++ ) {
- g[0].kcen = 1.0/wavelength + (gsl_rng_uniform_pos(rng)-0.5) * bandwidth/wavelength;
- g[0].sigma = spike_width/wavelength;
- g[0].height = 1;
+ g[i].kcen = 1.0/wavelength + (gsl_rng_uniform_pos(rng)-0.5) * bandwidth/wavelength;
+ g[i].sigma = spike_width/wavelength;
+ g[i].height = gsl_rng_uniform(rng);
}
spectrum_set_gaussians(s, g, 15);