aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/man/crystfel.732
-rw-r--r--doc/man/crystfel_geometry.54
-rw-r--r--libcrystfel/src/detector.c4
-rw-r--r--libcrystfel/src/detector.h1
-rw-r--r--libcrystfel/src/peaks.c6
-rw-r--r--tests/integration_check.c1
-rw-r--r--tests/symmetry_check.c1
7 files changed, 49 insertions, 0 deletions
diff --git a/doc/man/crystfel.7 b/doc/man/crystfel.7
index 3d9b3fb7..711b7552 100644
--- a/doc/man/crystfel.7
+++ b/doc/man/crystfel.7
@@ -81,6 +81,38 @@ H. N. Chapman. "CrystFEL: a software suite for snapshot serial crystallography".
Please let us know (see below) about your publication, so we can include it in
the list of examples on the CrystFEL website.
+.SH SYMMETRY IN CRYSTFEL
+Without only a very few exceptions, CrystFEL is not interested in space groups. Instead, it deals with point groups which embody the information about how data should be merged from different crystals. Every space group belongs to exactly one point group, and you can look up the right one in the International Tables or using the symmetry tables accompanying the CrystFEL source (or to be found on the CrystFEL website in the Theory section).
+
+A limitation of symmetry in the current version of CrystFEL is that it can only accept point groups in standard settings. That means that the highest-order rotation axis must always be parallel to c*, monoclinic unit cells should have \fIc\fR as the unique axis and so on. This is a limitation of the way your input, for example using the \fB-y\fR argument of \fBprocess_hkl\fR, is turned into CrystFEL's internal representation of symmetry, and so future versions should very soon be able to handle any setting.
+
+The options are:
+
+.IP Triclinic
+\fB1\fR, \fB-1\fR.
+
+.IP Monoclinic
+\fB2/m\fR, \fB2\fR, \fBm\fR.
+
+.IP Orthorhombic
+\fBmmm\fR, \fB222\fR, \fBmm2\fR.
+
+.IP Tetragonal
+\fB4/m\fR, \fB4\fR, \fB-4\fR, \fB4/mmm\fR, \fB422\fR, \fB-42m\fR, \fB-4m2\fR, \fB4mm\fR.
+
+.IP "Trigonal (rhombohedral axes)"
+\fB3_R\fR, \fB-3_R\fR, \fB32_R\fR, \fB3m_R\fR, \fB-3m_R\fR.
+
+.IP "Trigonal (hexagonal axes)"
+\fB3_H\fR, \fB-3_H\fR, \fB321_H\fR, \fB312_H\fR, \fB3m1_H\fR, \fB31m_H\fR, \fB-3m1_H\fR, \fB-31m_H\fR.
+
+.IP Hexagonal
+\fB6/m\fR, \fB6\fR, \fB-6\fR, \fB6/mmm\fR, \fB622\fR, \fB-62m\fR, \fB-6m2\fR, \fB6mm\fR.
+
+.IP Cubic
+\fB23\fR, \fBm-3\fR, \fB432\fR, \fB-43m\fR, \fBm-3m\fR.
+
+
.SH PROGRAM NAME
There seems to be a tendency to capitalise all the letters in the names of
programs in scientific publications. Sometimes the authors do this, other times
diff --git a/doc/man/crystfel_geometry.5 b/doc/man/crystfel_geometry.5
index 3254232b..006af722 100644
--- a/doc/man/crystfel_geometry.5
+++ b/doc/man/crystfel_geometry.5
@@ -170,6 +170,10 @@ peak_sep = 6.0
.br
; in which case the value will be used for all *subsequent* panels.
+; The maximum value, in ADU, before the pixel will be considered as bad.
+.br
+max_adu = 3500
+
.PP
See the "examples" folder for some examples (look at the ones ending in .geom).
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 94af656f..b7d809df 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -606,6 +606,8 @@ static int parse_field_for_panel(struct panel *panel, const char *key,
panel->coffset = atof(val);
} else if ( strcmp(key, "res") == 0 ) {
panel->res = atof(val);
+ } else if ( strcmp(key, "max_adu") == 0 ) {
+ panel->max_adu = atof(val);
} else if ( strcmp(key, "peak_sep") == 0 ) {
panel->peak_sep = atof(val);
} else if ( strcmp(key, "badrow_direction") == 0 ) {
@@ -743,6 +745,7 @@ struct detector *get_detector_geometry(const char *filename)
det->defaults.ssy = 1.0;
det->defaults.rigid_group = NULL;
det->defaults.adu_per_eV = NAN;
+ det->defaults.max_adu = +INFINITY;
strncpy(det->defaults.name, "", 1023);
do {
@@ -1254,6 +1257,7 @@ int write_detector_geometry(const char *filename, struct detector *det)
fprintf(fh, "%s/corner_x = %g\n", p->name, p->cnx);
fprintf(fh, "%s/corner_y = %g\n", p->name, p->cny);
fprintf(fh, "%s/adu_per_eV = %g\n", p->name, p->adu_per_eV);
+ fprintf(fh, "%s/max_adu = %g\n", p->name, p->max_adu);
if ( p->no_index ) {
fprintf(fh, "%s/no_index = 1\n", p->name);
diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h
index 02d66cd4..2b4ac5c6 100644
--- a/libcrystfel/src/detector.h
+++ b/libcrystfel/src/detector.h
@@ -65,6 +65,7 @@ struct panel
double peak_sep; /* Characteristic peak separation */
char *rigid_group; /* Rigid group, or -1 for none */
double adu_per_eV; /* Number of ADU per eV */
+ double max_adu; /* Treat pixel as unreliable if higher than this */
double fsx;
double fsy;
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index dac1a96e..583dff4c 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -210,6 +210,9 @@ int integrate_peak(struct image *image, int cfs, int css,
val = image->data[idx];
+ /* Veto peak if it contains saturation in bg region */
+ if ( val > p->max_adu ) return 1;
+
bg_tot += val;
bg_tot_sq += pow(val, 2.0);
bg_counts++;
@@ -258,6 +261,9 @@ int integrate_peak(struct image *image, int cfs, int css,
val = image->data[idx] - bg_mean;
+ /* Veto peak if it contains saturation */
+ if ( image->data[idx] > p->max_adu ) return 1;
+
pk_counts++;
pk_total += val;
diff --git a/tests/integration_check.c b/tests/integration_check.c
index 7e812ad5..2d18ac5a 100644
--- a/tests/integration_check.c
+++ b/tests/integration_check.c
@@ -197,6 +197,7 @@ int main(int argc, char *argv[])
image.det->panels[0].clen = 1.0;
image.det->panels[0].res = 1.0;
image.det->panels[0].adu_per_eV = 1.0/1000.0; /* -> 1 adu per photon */
+ image.det->panels[0].max_adu = +INFINITY; /* No cutoff */
image.width = 128;
image.height = 128;
diff --git a/tests/symmetry_check.c b/tests/symmetry_check.c
index b0047f35..edbacbf1 100644
--- a/tests/symmetry_check.c
+++ b/tests/symmetry_check.c
@@ -322,6 +322,7 @@ int main(int argc, char *argv[])
check_subgroup("432", "23", 1, 1, 2, &fail);
check_subgroup("6/m", "-3_H", 1, 1, 2, &fail);
check_subgroup("4/m", "-4", 1, 1, 2, &fail);
+ check_subgroup("622", "321_H", 1, 1, 2, &fail);
/* Tetartohedral */
check_subgroup("6/mmm", "-3_H", 1, 1, 4, &fail);