diff options
author | Thomas White <taw@physics.org> | 2021-03-10 16:48:28 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-03-11 15:59:11 +0100 |
commit | d6db66c2d57be8071465cfcac70baea4499c99df (patch) | |
tree | 96df69be8af0e959b6ed38c0bbb2a4377030bb79 /libcrystfel/src/integration.c | |
parent | e79af3cbb5f02528e403488e2a3bc7902fb3f382 (diff) |
detgeom_transform_coords: Take an additional detector shift
This allows the refined detector position to be used in a lot of places.
Diffstat (limited to 'libcrystfel/src/integration.c')
-rw-r--r-- | libcrystfel/src/integration.c | 13 |
1 files changed, 9 insertions, 4 deletions
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; i<image_feature_count(image->features); 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); |