aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-03-25 11:00:06 +0100
committerThomas White <taw@physics.org>2021-03-25 16:16:01 +0100
commit42fc18c3ce4af1dccdf511b1da8ab4b0860e3b96 (patch)
treed5d2a55064d706f84a3a404f392ee24183d78a87 /libcrystfel
parentd489df9ac6f9f76d3638121ffbe639a3c01a32de (diff)
PinkIndexer: fix conversion of detector shift
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/indexers/pinkindexer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libcrystfel/src/indexers/pinkindexer.c b/libcrystfel/src/indexers/pinkindexer.c
index c829bd1e..149bb5bd 100644
--- a/libcrystfel/src/indexers/pinkindexer.c
+++ b/libcrystfel/src/indexers/pinkindexer.c
@@ -81,12 +81,13 @@ static void restoreReciprocalCell(UnitCell *cell, LatticeTransform_t* appliedRed
static void makeRightHanded(UnitCell* cell);
+/* Return mean clen in m */
static double mean_clen(struct detgeom *dg)
{
int i;
double total = 0.0;
for ( i=0; i<dg->n_panels; i++ ) {
- total += dg->panels[i].cnz;
+ total += dg->panels[i].cnz * dg->panels[i].pixel_pitch;
}
return total / dg->n_panels;
}
@@ -100,7 +101,7 @@ static void scale_detector_shift(double fake_clen,
int i;
double mean = mean_clen(dg);
for ( i=0; i<dg->n_panels; i++ ) {
- if ( !within_tolerance(dg->panels[i].cnz, mean, 2.0) ) {
+ if ( !within_tolerance(dg->panels[i].cnz*dg->panels[i].pixel_pitch, mean, 2.0) ) {
ERROR("WARNING: Detector is not flat enough to apply "
"detector position offset\n");
*pdx = 0.0;