aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-01-22 15:50:15 +0100
committerThomas White <taw@physics.org>2010-01-22 15:50:15 +0100
commitef9281fb30a07b8ee099ada3e1f7a0a10cbca5c0 (patch)
tree42cee1574cb21a2c67796d6fa715631d56e6fd1e
parent59e333ee9e40ae0be0af08fe0eb739f1babf5771 (diff)
Remove 'xray_energy' to leave a single point of truth for wavelength
-rw-r--r--src/detector.c4
-rw-r--r--src/diffraction.c3
-rw-r--r--src/image.h2
-rw-r--r--src/pattern_sim.c3
4 files changed, 5 insertions, 7 deletions
diff --git a/src/detector.c b/src/detector.c
index 9b39a6b9..2c313cdc 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -153,7 +153,7 @@ void record_image(struct image *image, int do_water, int do_poisson,
/* How many photons are scattered per electron? */
area = M_PI*pow(BEAM_RADIUS, 2.0);
- total_energy = FLUENCE * image->xray_energy;
+ total_energy = FLUENCE * ph_lambda_to_en(image->lambda);
energy_density = total_energy / area;
ph_per_e = (FLUENCE/area) * pow(THOMSON_LENGTH, 2.0);
STATUS("Fluence = %8.2e photons, "
@@ -183,7 +183,7 @@ void record_image(struct image *image, int do_water, int do_poisson,
/* Add intensity contribution from water */
water = water_intensity(image->qvecs[x + image->width*y],
- image->xray_energy,
+ ph_lambda_to_en(image->lambda),
BEAM_RADIUS, WATER_RADIUS);
intensity += water;
diff --git a/src/diffraction.c b/src/diffraction.c
index 36717cfd..a0248450 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -162,7 +162,8 @@ void get_diffraction(struct image *image, int na, int nb, int nc)
* sizeof(double complex));
if ( image->molecule->reflections == NULL ) {
- get_reflections_cached(image->molecule, image->xray_energy);
+ get_reflections_cached(image->molecule,
+ ph_lambda_to_en(image->lambda));
}
for ( x=0; x<image->width; x++ ) {
diff --git a/src/image.h b/src/image.h
index ed4517ea..0f64d248 100644
--- a/src/image.h
+++ b/src/image.h
@@ -91,8 +91,6 @@ struct image {
/* Wavelength must always be given */
double lambda; /* Wavelength in m */
- double xray_energy; /* X-ray energy
- * in J (per photon) */
int width;
int height;
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 7aba8074..9e4abf90 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -217,8 +217,7 @@ int main(int argc, char *argv[])
image.y_centre = 512.5;
image.camera_len = 0.05; /* 5 cm (front CCD can move from 5cm-20cm) */
image.resolution = 13333.3; /* 75 micron pixel size */
- image.xray_energy = eV_to_J(2.0e3); /* 2 keV energy */
- image.lambda = ph_en_to_lambda(image.xray_energy); /* Wavelength */
+ image.lambda = ph_en_to_lambda(eV_to_J(2.0e3)); /* Wavelength */
image.molecule = NULL;
/* Splurge a few useful numbers */