aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
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
parentac917e9fb67bf01b0264e1ce60b5d911f03984b5 (diff)
Remove beam radius and nphotons from struct beam_params
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/detector.c10
-rw-r--r--libcrystfel/src/detector.h2
-rw-r--r--libcrystfel/src/image.h2
3 files changed, 6 insertions, 8 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++ ) {
diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h
index ba88c12e..519de050 100644
--- a/libcrystfel/src/detector.h
+++ b/libcrystfel/src/detector.h
@@ -181,7 +181,7 @@ extern double get_tt(struct image *image, double xs, double ys, int *err);
extern int in_bad_region(struct detector *det, double fs, double ss);
extern void record_image(struct image *image, int do_poisson, int background,
- gsl_rng *rng);
+ gsl_rng *rng, double beam_radius, double nphotons);
extern struct panel *find_panel(struct detector *det, double fs, double ss);
diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h
index 0a64e081..bc78147e 100644
--- a/libcrystfel/src/image.h
+++ b/libcrystfel/src/image.h
@@ -100,8 +100,6 @@ struct sample
struct beam_params
{
- double fluence; /* photons per pulse */
- double beam_radius; /* metres */
double photon_energy; /* eV per photon */
char *photon_energy_from; /* HDF5 dataset name */
double photon_energy_scale; /* Scale factor for photon energy, if the