diff options
author | Thomas White <taw@physics.org> | 2009-11-20 17:53:00 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2009-11-20 17:53:00 +0100 |
commit | f7f13c14c8a742888324518f0cb64ce1c99d9d1c (patch) | |
tree | c300455fe033eccc162376debc3dc303557d9b6f /src | |
parent | 1a2e14c4c22f2e36bee3e294e86a21dcad47b00f (diff) |
Clearer solid angle calculation
Diffstat (limited to 'src')
-rw-r--r-- | src/detector.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/detector.c b/src/detector.c index 1c09b149..41019551 100644 --- a/src/detector.c +++ b/src/detector.c @@ -138,17 +138,17 @@ void record_image(struct image *image) { int x, y; double ph_per_e; - double twotheta_max, np, sa_per_pixel; + double sa_per_pixel; /* How many photons are scattered per electron? */ ph_per_e = PULSE_ENERGY_DENSITY * pow(THOMSON_LENGTH, 2.0) / image->xray_energy; printf("%e photons are scattered per electron\n", ph_per_e); - twotheta_max = image->twotheta[0]; - np = sqrt(pow(image->x_centre, 2.0) + pow(image->y_centre, 2.0)); - sa_per_pixel = pow(2.0 * twotheta_max / np, 2.0); - printf("sa per pixel=%e\n", sa_per_pixel); + /* Solid angle subtended by a single pixel at the centre of the CCD */ + sa_per_pixel = pow(1.0/image->resolution, 2.0) / image->camera_len; + printf("Solid angle of pixel (at centre of CCD) = %e sr\n", + sa_per_pixel); image->hdr = malloc(image->width * image->height * sizeof(double)); |