aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
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);