aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-11-26 12:20:05 +0100
committerThomas White <taw@physics.org>2009-11-26 12:20:14 +0100
commit3d22f28223ee6dcef7e8d0cba247ac112942e344 (patch)
tree8dd47d46eb78bc52ce284ec833af46342320e86a /src
parentfe9063f6c7b353d6ab983052d55fe63b093a5335 (diff)
Move constants around
Diffstat (limited to 'src')
-rw-r--r--src/detector.c6
-rw-r--r--src/diffraction.c18
-rw-r--r--src/diffraction.h3
-rw-r--r--src/utils.h11
4 files changed, 21 insertions, 17 deletions
diff --git a/src/detector.c b/src/detector.c
index 1e0e4a2f..9f28a624 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -29,6 +29,9 @@
/* Detector's saturation value */
#define SATURATION (60000)
+/* Radius of X-ray beam */
+#define BEAM_RADIUS (3.0e-6)
+
/* Bleed excess intensity into neighbouring pixels */
static void bloom_values(double *tmp, int x, int y,
@@ -169,7 +172,8 @@ void record_image(struct image *image)
/* Add intensity contribution from water */
water = water_intensity(image->qvecs[x + image->width*y],
- image->xray_energy);
+ image->xray_energy,
+ BEAM_RADIUS, 1.5e-6);
//printf("%e, %e, ", intensity, water);
intensity += water;
diff --git a/src/diffraction.c b/src/diffraction.c
index f1322c04..10e12c4d 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -23,15 +23,8 @@
#include "diffraction.h"
#include "sfac.h"
-
-/* Density of water in kg/m^3 */
-#define WATER_DENSITY (1.0e6)
-
-/* Molar mass of water, in kg/mol */
-#define WATER_MOLAR_MASS (18.01528e3)
-
-/* Avogadro's number */
-#define AVOGADRO (6.022e23)
+/* Radius of beam (m) */
+#define BEAM_RADIUS (1.5e-6)
static double lattice_factor(struct threevec q, double ax, double ay, double az,
@@ -99,7 +92,8 @@ static double complex molecule_factor(struct molecule *mol, struct threevec q,
}
-double water_intensity(struct threevec q, double en)
+double water_intensity(struct threevec q, double en,
+ double beam_r, double water_r)
{
double complex fH, fO;
double s, modq;
@@ -109,10 +103,6 @@ double water_intensity(struct threevec q, double en)
const double rOH = 0.09584e-9;
const double rHH = 0.1515e-9;
- /* Dimensions of water column */
- const double water_r = 0.5e-6;
- const double beam_r = 1.5e-6;
-
/* Volume of water column */
const double water_v = M_PI*pow(water_r, 2.0) * 2.0 * beam_r;
diff --git a/src/diffraction.h b/src/diffraction.h
index e2994a0b..1e08e116 100644
--- a/src/diffraction.h
+++ b/src/diffraction.h
@@ -20,6 +20,7 @@
#include "cell.h"
extern void get_diffraction(struct image *image);
-extern double water_intensity(struct threevec q, double en);
+extern double water_intensity(struct threevec q, double en,
+ double beam_r, double water_r);
#endif /* DIFFRACTION_H */
diff --git a/src/utils.h b/src/utils.h
index c89466c3..b4b5a58e 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -36,8 +36,17 @@
/* Thomson scattering length (m) */
#define THOMSON_LENGTH (2.81794e-15)
+/* Density of water in kg/m^3 */
+#define WATER_DENSITY (1.0e6)
-/* --------------------------- Useful datatypes ----------------------------- */
+/* Molar mass of water, in kg/mol */
+#define WATER_MOLAR_MASS (18.01528e3)
+
+/* Avogadro's number */
+#define AVOGADRO (6.022e23)
+
+
+/* ------------------------------ Quaternions ------------------------------- */
struct quaternion
{