aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-09-05 15:28:31 +0200
committerThomas White <taw@physics.org>2019-09-05 15:28:31 +0200
commit4640801af015f6eb46f12d17b22f8c0767a0091e (patch)
tree8613b401716b9e33e76a0517fc9f9edeed01f4ee /libcrystfel/src
parent9fb94994155948fdc7c1f3034e4e628bad32484d (diff)
Allow the polarsation correction to be completely disabled
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/geometry.c6
-rw-r--r--libcrystfel/src/geometry.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c
index 13fcbe3b..fa896cd0 100644
--- a/libcrystfel/src/geometry.c
+++ b/libcrystfel/src/geometry.c
@@ -967,10 +967,12 @@ struct polarisation parse_polarisation(const char *text)
if ( strcmp(text, "none") == 0 ) {
p.fraction = 0.5;
p.angle = 0.0;
+ p.disable = 1;
return p;
}
p.fraction = 1.0;
+ p.disable = 0;
i = 0;
n = 0;
@@ -1027,6 +1029,10 @@ void polarisation_correction(RefList *list, UnitCell *cell,
double bsx, bsy, bsz;
double csx, csy, csz;
+ if ( p.disable ) {
+ return;
+ }
+
cell_get_reciprocal(cell, &asx, &asy, &asz,
&bsx, &bsy, &bsz,
&csx, &csy, &csz);
diff --git a/libcrystfel/src/geometry.h b/libcrystfel/src/geometry.h
index db3c0fe8..0a403a9c 100644
--- a/libcrystfel/src/geometry.h
+++ b/libcrystfel/src/geometry.h
@@ -97,8 +97,12 @@ enum gparam {
struct polarisation
{
double fraction; /**< Polarisation fraction (0 to 1) */
+
double angle; /**< Angle of electron beam, radians, clockwise from
* horizontal when looking along beam */
+
+ int disable; /**< If set, don't even correct for the polarisation
+ * of the diffracted beam (1 - 0.5sin^2(2theta)) */
};