diff options
author | Thomas White <taw@physics.org> | 2023-06-20 10:58:27 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-07-28 13:22:05 +0200 |
commit | 5d803715265336cb005fa085fb2f6c86e4c832b7 (patch) | |
tree | 4554ccbd792d2cf1d9d2633f263167ef1303adbd /libcrystfel/src/detgeom.c | |
parent | 5007a946fab23f0363020918dd5acf48294b9dde (diff) |
Add detgeom_translate_detector_m
Diffstat (limited to 'libcrystfel/src/detgeom.c')
-rw-r--r-- | libcrystfel/src/detgeom.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libcrystfel/src/detgeom.c b/libcrystfel/src/detgeom.c index 988d3f28..a8f8b079 100644 --- a/libcrystfel/src/detgeom.c +++ b/libcrystfel/src/detgeom.c @@ -213,3 +213,15 @@ void detgeom_show_hierarchy(const struct detgeom *dg) { detgeom_show_group(dg->top_group, 0); } + + +void detgeom_translate_detector_m(struct detgeom *dg, double x, double y, double z) +{ + int i; + for ( i=0; i<dg->n_panels; i++ ) { + struct detgeom_panel *p = &dg->panels[i]; + p->cnx += x / p->pixel_pitch; + p->cny += y / p->pixel_pitch; + p->cnz += z / p->pixel_pitch; + } +} |