aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-05-26 17:56:57 +0200
committerThomas White <taw@physics.org>2010-05-26 17:56:57 +0200
commit086e7ecfc9bb1cffaecc6985491210331b221052 (patch)
tree0a70f59f466e7de9a075c96a623753328d18e626 /src/peaks.c
parent3b9d3e5b25e447a2e010903d2900262a929c31f2 (diff)
Make polarisation correction optional (whoops)
Diffstat (limited to 'src/peaks.c')
-rw-r--r--src/peaks.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/peaks.c b/src/peaks.c
index 27e12910..20779bb3 100644
--- a/src/peaks.c
+++ b/src/peaks.c
@@ -183,10 +183,14 @@ static void integrate_peak(struct image *image, int xp, int yp,
/* Projected area of pixel divided by distance squared */
sa = 1.0e7 * proj_area / (dsq + Lsq);
- phi = atan2(y+yp, x+xp);
- pa = pow(sin(phi)*sin(tt), 2.0);
- pb = pow(cos(tt), 2.0);
- pol = 1.0 - 2.0*POL*(1-pa) + POL*(1.0+pb);
+ if ( do_polar ) {
+ phi = atan2(y+yp, x+xp);
+ pa = pow(sin(phi)*sin(tt), 2.0);
+ pb = pow(cos(tt), 2.0);
+ pol = 1.0 - 2.0*POL*(1-pa) + POL*(1.0+pb);
+ } else {
+ pol = 1.0;
+ }
val = image->data[(x+xp)+image->width*(y+yp)] / (sa*pol);