aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/partial_sim.c26
-rw-r--r--src/pattern_sim.c13
2 files changed, 9 insertions, 30 deletions
diff --git a/src/partial_sim.c b/src/partial_sim.c
index 16e9cb88..ae448ba8 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -3,11 +3,11 @@
*
* Generate partials for testing scaling
*
- * Copyright © 2012-2015 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2016 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2011-2015 Thomas White <taw@physics.org>
+ * 2011-2016 Thomas White <taw@physics.org>
* 2014 Valerio Mariani
*
* This file is part of CrystFEL.
@@ -170,18 +170,6 @@ static void calculate_partials(Crystal *cr,
}
-static signed int panel_number(struct detector *det, struct panel *p)
-{
- int i;
-
- for ( i=0; i<det->n_panels; i++ ) {
- if ( &det->panels[i] == p ) return i;
- }
-
- return -1;
-}
-
-
static void draw_and_write_image(struct image *image, RefList *reflections,
gsl_rng *rng, double background)
{
@@ -224,11 +212,11 @@ static void draw_and_write_image(struct image *image, RefList *reflections,
get_detector_pos(refl, &dfs, &dss);
p = get_panel(refl);
- pn = panel_number(image->det, p); /* Yeurgh */
- assert(pn != -1);
+ pn = panel_number(image->det, p);
+ assert(pn != image->det->n_panels);
- fs = nearbyint(dfs) - p->min_fs;
- ss = nearbyint(dss) - p->min_ss;
+ fs = nearbyint(dfs);
+ ss = nearbyint(dss);
assert(fs >= 0);
assert(ss >= 0);
assert(fs < p->w);
@@ -829,8 +817,6 @@ int main(int argc, char *argv[])
image.det = det;
image.beam = &beam;
- image.width = det->max_fs + 1;
- image.height = det->max_ss + 1;
image.lambda = ph_en_to_lambda(eV_to_J(photon_energy));
image.div = divergence;
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 262e3976..d111091b 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -3,11 +3,11 @@
*
* Simulate diffraction patterns from small crystals
*
- * Copyright © 2012-2015 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2016 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2009-2015 Thomas White <taw@physics.org>
+ * 2009-2016 Thomas White <taw@physics.org>
* 2013-2014 Chun Hong Yoon <chun.hong.yoon@desy.de>
* 2014 Valerio Mariani
* 2013 Alexandra Tolstikova
@@ -655,12 +655,7 @@ int main(int argc, char *argv[])
}
- /* Define image parameters */
- image.width = image.det->max_fs + 1;
- image.height = image.det->max_ss + 1;
-
- double wl = ph_en_to_lambda(eV_to_J(photon_energy));
- image.lambda = wl;
+ image.lambda = ph_en_to_lambda(eV_to_J(photon_energy));
image.bw = bandwidth;
image.nsamples = nsamples;
@@ -693,8 +688,6 @@ int main(int argc, char *argv[])
gsl_rng_set(rng, seed);
}
- powder.width = image.width;
- powder.height = image.height;
powder.det = image.det;
powder.beam = NULL;
powder.lambda = 0.0;