aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/datatemplate.c12
-rw-r--r--libcrystfel/src/predict-refine.c24
-rw-r--r--tests/gradient_check.c12
3 files changed, 24 insertions, 24 deletions
diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c
index cbec604f..36c0a422 100644
--- a/libcrystfel/src/datatemplate.c
+++ b/libcrystfel/src/datatemplate.c
@@ -2222,16 +2222,16 @@ static int rotate_all_panels(DataTemplate *dtempl,
switch ( axis )
{
case 'x':
- rotate2d(&cnz_px, &p->cny, cz, cy, ang);
- rotate2d(&p->fsz, &p->fsy, 0, 0, ang);
- rotate2d(&p->ssz, &p->ssy, 0, 0, ang);
+ rotate2d(&p->cny, &cnz_px, cy, cz, ang);
+ rotate2d(&p->fsy, &p->fsz, 0, 0, ang);
+ rotate2d(&p->ssy, &p->ssz, 0, 0, ang);
p->cnz_offset = cnz_px * p->pixel_pitch;
break;
case 'y':
- rotate2d(&p->cnx, &cnz_px, cx, cz, ang);
- rotate2d(&p->fsx, &p->fsz, 0, 0, ang);
- rotate2d(&p->ssx, &p->ssz, 0, 0, ang);
+ rotate2d(&cnz_px, &p->cnx, cz, cx, ang);
+ rotate2d(&p->fsz, &p->fsx, 0, 0, ang);
+ rotate2d(&p->ssz, &p->ssx, 0, 0, ang);
p->cnz_offset = cnz_px * p->pixel_pitch;
break;
diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c
index 4fdccef4..43b54092 100644
--- a/libcrystfel/src/predict-refine.c
+++ b/libcrystfel/src/predict-refine.c
@@ -232,21 +232,21 @@ int fs_ss_gradient_panel(int param, Reflection *refl, UnitCell *cell,
break;
case GPARAM_DET_RX :
- gsl_matrix_set(dMdp, 1, 0, p->pixel_pitch*p->cnz-cz);
- gsl_matrix_set(dMdp, 2, 0, cy-p->pixel_pitch*p->cny);
- gsl_matrix_set(dMdp, 1, 1, p->pixel_pitch*p->fsz);
- gsl_matrix_set(dMdp, 2, 1, -p->pixel_pitch*p->fsy);
- gsl_matrix_set(dMdp, 1, 2, p->pixel_pitch*p->ssz);
- gsl_matrix_set(dMdp, 2, 2, -p->pixel_pitch*p->ssy);
+ gsl_matrix_set(dMdp, 1, 0, cz-p->pixel_pitch*p->cnz);
+ gsl_matrix_set(dMdp, 2, 0, p->pixel_pitch*p->cny-cy);
+ gsl_matrix_set(dMdp, 1, 1, -p->pixel_pitch*p->fsz);
+ gsl_matrix_set(dMdp, 2, 1, p->pixel_pitch*p->fsy);
+ gsl_matrix_set(dMdp, 1, 2, -p->pixel_pitch*p->ssz);
+ gsl_matrix_set(dMdp, 2, 2, p->pixel_pitch*p->ssy);
break;
case GPARAM_DET_RY :
- gsl_matrix_set(dMdp, 0, 0, cz-p->pixel_pitch*p->cnz);
- gsl_matrix_set(dMdp, 2, 0, p->pixel_pitch*p->cnx-cx);
- gsl_matrix_set(dMdp, 0, 1, -p->pixel_pitch*p->fsz);
- gsl_matrix_set(dMdp, 2, 1, p->pixel_pitch*p->fsx);
- gsl_matrix_set(dMdp, 0, 2, -p->pixel_pitch*p->ssz);
- gsl_matrix_set(dMdp, 2, 2, p->pixel_pitch*p->ssx);
+ gsl_matrix_set(dMdp, 0, 0, p->pixel_pitch*p->cnz-cz);
+ gsl_matrix_set(dMdp, 2, 0, cx-p->pixel_pitch*p->cnx);
+ gsl_matrix_set(dMdp, 0, 1, p->pixel_pitch*p->fsz);
+ gsl_matrix_set(dMdp, 2, 1, -p->pixel_pitch*p->fsx);
+ gsl_matrix_set(dMdp, 0, 2, p->pixel_pitch*p->ssz);
+ gsl_matrix_set(dMdp, 2, 2, -p->pixel_pitch*p->ssx);
break;
case GPARAM_DET_RZ :
diff --git a/tests/gradient_check.c b/tests/gradient_check.c
index c60a0588..001bff7a 100644
--- a/tests/gradient_check.c
+++ b/tests/gradient_check.c
@@ -72,18 +72,18 @@ int main(int argc, char *argv[])
#ifdef ROTATE_PANEL_X
struct detgeom_panel *p = &image.detgeom->panels[0];
step = deg2rad(0.01);
- rotate2d(&p->cnz, &p->cny, cz/p->pixel_pitch, cy/p->pixel_pitch, step);
- rotate2d(&p->fsz, &p->fsy, 0, 0, step);
- rotate2d(&p->ssz, &p->ssy, 0, 0, step);
+ rotate2d(&p->cny, &p->cnz, cy/p->pixel_pitch, cz/p->pixel_pitch, step);
+ rotate2d(&p->fsy, &p->fsz, 0, 0, step);
+ rotate2d(&p->ssy, &p->ssz, 0, 0, step);
didsomething = 1;
#endif
#ifdef ROTATE_PANEL_Y
struct detgeom_panel *p = &image.detgeom->panels[0];
step = deg2rad(0.01);
- rotate2d(&p->cnx, &p->cnz, cx/p->pixel_pitch, cz/p->pixel_pitch, step);
- rotate2d(&p->fsx, &p->fsz, 0, 0, step);
- rotate2d(&p->ssx, &p->ssz, 0, 0, step);
+ rotate2d(&p->cnz, &p->cnx, cz/p->pixel_pitch, cx/p->pixel_pitch, step);
+ rotate2d(&p->fsz, &p->fsx, 0, 0, step);
+ rotate2d(&p->ssz, &p->ssx, 0, 0, step);
didsomething = 1;
#endif