From 4977cb7c384f9339037353f31abf0a6a8fd2aea7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 27 Jun 2023 15:45:21 +0200 Subject: r_gradient: Re-order parameters to match {fs,ss}_gradient --- libcrystfel/src/predict-refine.c | 12 ++++++------ libcrystfel/src/predict-refine.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c index d8547710..e2adacf5 100644 --- a/libcrystfel/src/predict-refine.c +++ b/libcrystfel/src/predict-refine.c @@ -72,7 +72,7 @@ double ss_dev(struct reflpeak *rp, struct detgeom *det) } -double r_gradient(UnitCell *cell, int k, Reflection *refl, struct image *image) +double r_gradient(int param, Reflection *refl, UnitCell *cell, double wavelength) { double asx, asy, asz; double bsx, bsy, bsz; @@ -91,10 +91,10 @@ double r_gradient(UnitCell *cell, int k, Reflection *refl, struct image *image) zl = hs*asz + ks*bsz + ls*csz; tl = sqrt(xl*xl + yl*yl); - phi = angle_between_2d(tl, zl+1.0/image->lambda, 0.0, 1.0); /* 2theta */ + phi = angle_between_2d(tl, zl+1.0/wavelength, 0.0, 1.0); /* 2theta */ azi = atan2(yl, xl); /* azimuth */ - switch ( k ) { + switch ( param ) { case GPARAM_ASX : return - hs * sin(phi) * cos(azi); @@ -134,7 +134,7 @@ double r_gradient(UnitCell *cell, int k, Reflection *refl, struct image *image) } - ERROR("No r gradient defined for parameter %i\n", k); + ERROR("No r gradient defined for parameter %i\n", param); abort(); } @@ -550,8 +550,8 @@ static int iterate(struct reflpeak *rps, int n, UnitCell *cell, struct image *im w = rps[i].Ih; for ( k=0; klambda); } for ( k=0; k