From 4640801af015f6eb46f12d17b22f8c0767a0091e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 5 Sep 2019 15:28:31 +0200 Subject: Allow the polarsation correction to be completely disabled --- libcrystfel/src/geometry.c | 6 ++++++ libcrystfel/src/geometry.h | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'libcrystfel/src') 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)) */ }; -- cgit v1.2.3