diff options
-rw-r--r-- | doc/man/partialator.1 | 4 | ||||
-rw-r--r-- | doc/man/process_hkl.1 | 4 | ||||
-rw-r--r-- | libcrystfel/src/geometry.c | 6 | ||||
-rw-r--r-- | libcrystfel/src/geometry.h | 4 | ||||
-rw-r--r-- | src/partialator.c | 6 | ||||
-rw-r--r-- | src/process_hkl.c | 6 |
6 files changed, 24 insertions, 6 deletions
diff --git a/doc/man/partialator.1 b/doc/man/partialator.1 index 63b7578e..0cadc000 100644 --- a/doc/man/partialator.1 +++ b/doc/man/partialator.1 @@ -95,7 +95,9 @@ Run \fIn\fR analyses in parallel. .PD 0 .IP \fB--polarisation=\fItype\fR .PD -Specify the polarisation of the incident radiation. \fItype\fR can be \fBhoriz\fR, \fBvert\fR or \fBnone\fR to indicate 100% polarisation of the electric field in the horizontal plane, vertical plane or completely unpolarised radiation respectively. Alternatively, \fItype\fR can be a direction followed by a percentage polarisation fraction. For example, \fB45deg90\fR means that 90% of the radiation is polarised with its electric field in a direction 45 degrees from horizontal, and \fB10deg100\fR means that all the radiation is polarised at 10 degrees from horizontal. The angle is specified clockwise from horizontal as viewed along the beam direction, i.e. as shown by \fBhdfsee\fR. The beam is unpolarised when the fraction is 50% (equal parts of the radiation have their electric field in the specified plane). If the polarisation fraction is 100%, it can be omitted. For example \fB10deg\fR or \fBhoriz\fR. +Specify the polarisation of the incident radiation. \fItype\fR can be \fBhoriz\fR or \fBvert\fR to indicate 100% polarisation of the electric field in the horizontal plane or vertical plane respectively. Setting \fItype\fR to \fBnone\fR completely disables the polarisation correction (see the note below). Alternatively, \fItype\fR can be a direction followed by a percentage polarisation fraction. For example, \fB45deg90\fR means that 90% of the radiation is polarised with its electric field in a direction 45 degrees from horizontal, and \fB10deg100\fR means that all the radiation is polarised at 10 degrees from horizontal. The angle is specified clockwise from horizontal as viewed along the beam direction, i.e. as shown by \fBhdfsee\fR. The beam is unpolarised when the fraction is 50% (equal parts of the radiation have their electric field in the specified plane). If the polarisation fraction is 100%, it can be omitted. For example \fB10deg\fR or \fBhoriz\fR. + +Note that \fB--polarisation=none\fR is not the same as, for example, \fB--polarisation=vert50\fR. In the first case, the polarisation correction will be completely disabled. In the other case, the incident beam will be unpolarised, but the polarisation of the diffracted radiation will still be corrected for (the factor of (1+cos^2(2theta))/2 or, equivalently, (2-sin^2(2theta))/2). The default is \fB--polarisation=horiz\fR. diff --git a/doc/man/process_hkl.1 b/doc/man/process_hkl.1 index d01cfc5d..1d73963d 100644 --- a/doc/man/process_hkl.1 +++ b/doc/man/process_hkl.1 @@ -86,7 +86,9 @@ Use \fBpartialator\fR if you need more advanced merging techniques. .PD 0 .IP \fB--polarisation=\fItype\fR .PD -Specify the polarisation of the incident radiation. \fItype\fR can be \fBhoriz\fR, \fBvert\fR or \fBnone\fR to indicate 100% polarisation of the electric field in the horizontal plane, vertical plane or completely unpolarised radiation respectively. Alternatively, \fItype\fR can be a direction followed by a percentage polarisation fraction. For example, \fB45deg90\fR means that 90% of the radiation is polarised with its electric field in a direction 45 degrees from horizontal, and \fB10deg100\fR means that all the radiation is polarised at 10 degrees from horizontal. The angle is specified clockwise from horizontal as viewed along the beam direction, i.e. as shown by \fBhdfsee\fR. The beam is unpolarised when the fraction is 50% (equal parts of the radiation have their electric field in the specified plane). If the polarisation fraction is 100%, it can be omitted. For example \fB10deg\fR or \fBhoriz\fR. +Specify the polarisation of the incident radiation. \fItype\fR can be \fBhoriz\fR or \fBvert\fR to indicate 100% polarisation of the electric field in the horizontal plane or vertical plane respectively. Setting \fItype\fR to \fBnone\fR completely disables the polarisation correction (see the note below). Alternatively, \fItype\fR can be a direction followed by a percentage polarisation fraction. For example, \fB45deg90\fR means that 90% of the radiation is polarised with its electric field in a direction 45 degrees from horizontal, and \fB10deg100\fR means that all the radiation is polarised at 10 degrees from horizontal. The angle is specified clockwise from horizontal as viewed along the beam direction, i.e. as shown by \fBhdfsee\fR. The beam is unpolarised when the fraction is 50% (equal parts of the radiation have their electric field in the specified plane). If the polarisation fraction is 100%, it can be omitted. For example \fB10deg\fR or \fBhoriz\fR. + +Note that \fB--polarisation=none\fR is not the same as, for example, \fB--polarisation=vert50\fR. In the first case, the polarisation correction will be completely disabled. In the other case, the incident beam will be unpolarised, but the polarisation of the diffracted radiation will still be corrected for (the factor of (1+cos^2(2theta))/2 or, equivalently, (2-sin^2(2theta))/2). The default is \fB--polarisation=horiz\fR. 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)) */ }; diff --git a/src/partialator.c b/src/partialator.c index ee577595..e92a80ac 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -952,7 +952,9 @@ int main(int argc, char *argv[]) PartialityModel pmodel = PMODEL_XSPHERE; int min_measurements = 2; char *rval; - struct polarisation polarisation = {.fraction = 1.0, .angle= 0.0}; + struct polarisation polarisation = {.fraction = 1.0, + .angle = 0.0, + .disable = 0}; int start_after = 0; int stop_after = 0; double max_adu = +INFINITY; @@ -1190,7 +1192,7 @@ int main(int argc, char *argv[]) break; case 15 : - polarisation.fraction = 0.5; + polarisation = parse_polarisation("none"); break; case 0 : diff --git a/src/process_hkl.c b/src/process_hkl.c index 4ace75f4..4e31e303 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -505,7 +505,9 @@ int main(int argc, char *argv[]) int hist_i; int space_for_hist = 0; char *histo_params = NULL; - struct polarisation polarisation = {.fraction = 1.0, .angle= 0.0}; + struct polarisation polarisation = {.fraction = 1.0, + .angle = 0.0, + .disable = 0}; char *rval; int min_measurements = 2; int r; @@ -677,7 +679,7 @@ int main(int argc, char *argv[]) break; case 11 : - polarisation.fraction = 0.5; + polarisation = parse_polarisation("none"); break; case 0 : |