aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/detector.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-09-24 16:07:24 +0200
committerThomas White <taw@physics.org>2014-09-24 16:07:24 +0200
commit9ce505843376f26996fb818b4ab972073b445f94 (patch)
tree738553e7b69d002b38748bd6d3daa1c1254f88fa /libcrystfel/src/detector.c
parentac917e9fb67bf01b0264e1ce60b5d911f03984b5 (diff)
Remove beam radius and nphotons from struct beam_params
Diffstat (limited to 'libcrystfel/src/detector.c')
-rw-r--r--libcrystfel/src/detector.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 9972e2ba..4a202f2e 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -323,7 +323,7 @@ double get_tt(struct image *image, double fs, double ss, int *err)
void record_image(struct image *image, int do_poisson, int background,
- gsl_rng *rng)
+ gsl_rng *rng, double beam_radius, double nphotons)
{
int x, y;
double total_energy, energy_density;
@@ -338,14 +338,14 @@ void record_image(struct image *image, int do_poisson, int background,
int n_nan2 = 0;
/* How many photons are scattered per electron? */
- area = M_PI*pow(image->beam->beam_radius, 2.0);
- total_energy = image->beam->fluence * ph_lambda_to_en(image->lambda);
+ area = M_PI*pow(beam_radius, 2.0);
+ total_energy = nphotons * ph_lambda_to_en(image->lambda);
energy_density = total_energy / area;
- ph_per_e = (image->beam->fluence /area) * pow(THOMSON_LENGTH, 2.0);
+ ph_per_e = (nphotons /area) * pow(THOMSON_LENGTH, 2.0);
STATUS("Fluence = %8.2e photons, "
"Energy density = %5.3f kJ/cm^2, "
"Total energy = %5.3f microJ\n",
- image->beam->fluence, energy_density/1e7, total_energy*1e6);
+ nphotons, energy_density/1e7, total_energy*1e6);
for ( x=0; x<image->width; x++ ) {
for ( y=0; y<image->height; y++ ) {