aboutsummaryrefslogtreecommitdiff
path: root/src/detector.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-11-27 15:18:24 +0100
committerThomas White <taw@physics.org>2009-11-27 15:18:41 +0100
commit7fb6226e91449278537f4bf71a8ccd35cda02e02 (patch)
treec8c7bc43ef2140417601b6c89395e3ee03b9b484 /src/detector.c
parent9e3ebf0fd97a3a2d47093a8da9fa2d55f57394a9 (diff)
Signal decreases with increasing probe size
Diffstat (limited to 'src/detector.c')
-rw-r--r--src/detector.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/detector.c b/src/detector.c
index 23378e90..52f24b1e 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -20,8 +20,8 @@
#include "diffraction.h"
-/* Pulse energy density in J/m^2 */
-#define PULSE_ENERGY_DENSITY (30.0e7)
+/* Number of photons in pulse */
+#define FLUENCE (1.0e13)
/* Detector's quantum efficiency */
#define DQE (0.9)
@@ -144,7 +144,7 @@ static uint16_t *bloom(double *hdr_in, int width, int height)
void record_image(struct image *image)
{
int x, y;
- double fluence;
+ double total_energy, energy_density;
double ph_per_e;
double pix_area, Lsq;
double area;
@@ -152,10 +152,13 @@ void record_image(struct image *image)
/* How many photons are scattered per electron? */
area = M_PI*pow(BEAM_RADIUS, 2.0);
- fluence = PULSE_ENERGY_DENSITY / image->xray_energy;
- ph_per_e = fluence * pow(THOMSON_LENGTH, 2.0);
- printf("Fluence = %5e photons / m^2, %5e photons total\n",
- fluence, fluence*area);
+ total_energy = FLUENCE * image->xray_energy;
+ energy_density = total_energy / area;
+ ph_per_e = (FLUENCE/area) * pow(THOMSON_LENGTH, 2.0);
+ printf("Fluence = %8.2e photons, "
+ "Energy density = %5.3f kJ/cm^2, "
+ "Total energy = %5.3f microJ\n",
+ FLUENCE, energy_density/1e7, total_energy*1e6);
/* Area of one pixel */
pix_area = pow(1.0/image->resolution, 2.0);