From 086e7ecfc9bb1cffaecc6985491210331b221052 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 26 May 2010 17:56:57 +0200 Subject: Make polarisation correction optional (whoops) --- src/peaks.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/peaks.c') 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); -- cgit v1.2.3