From d6db66c2d57be8071465cfcac70baea4499c99df Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 10 Mar 2021 16:48:28 +0100 Subject: detgeom_transform_coords: Take an additional detector shift This allows the refined detector position to be used in a lot of places. --- libcrystfel/src/integration.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'libcrystfel/src/integration.c') diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index d88e769c..4c813a11 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -1518,7 +1518,7 @@ int integrate_rings_once(Reflection *refl, } -static double estimate_resolution(UnitCell *cell, struct image *image) +static double estimate_resolution(Crystal *cr, struct image *image) { int i; const double min_dist = 0.25; @@ -1527,6 +1527,9 @@ static double estimate_resolution(UnitCell *cell, struct image *image) int n_acc = 0; int max_acc = 1024; int n; + double dx, dy; + UnitCell *cell; + acc = malloc(max_acc*sizeof(double)); if ( acc == NULL ) { @@ -1534,6 +1537,9 @@ static double estimate_resolution(UnitCell *cell, struct image *image) return INFINITY; } + cell = crystal_get_cell(cr); + crystal_get_det_shift(cr, &dx, &dy); + for ( i=0; ifeatures); i++ ) { struct imagefeature *f; @@ -1554,7 +1560,7 @@ static double estimate_resolution(UnitCell *cell, struct image *image) detgeom_transform_coords(&image->detgeom->panels[f->pn], f->fs, f->ss, image->lambda, - r); + dx, dy, r); /* Decimal and fractional Miller indices of nearest * reciprocal lattice point */ @@ -1670,8 +1676,7 @@ void integrate_all_5(struct image *image, IntegrationMethod meth, saved_R * 5); } - res = estimate_resolution(crystal_get_cell(image->crystals[i]), - image); + res = estimate_resolution(image->crystals[i], image); crystal_set_resolution_limit(image->crystals[i], res); list = predict_to_res(image->crystals[i], res+push_res); -- cgit v1.2.3