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 | |
parent | 5007a946fab23f0363020918dd5acf48294b9dde (diff) |
Add detgeom_translate_detector_m
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/detgeom.c | 12 | ||||
-rw-r--r-- | libcrystfel/src/detgeom.h | 2 |
2 files changed, 14 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; + } +} diff --git a/libcrystfel/src/detgeom.h b/libcrystfel/src/detgeom.h index 22f5bd1a..cf4968f8 100644 --- a/libcrystfel/src/detgeom.h +++ b/libcrystfel/src/detgeom.h @@ -140,6 +140,8 @@ extern struct detgeom_panel *detgeom_find_panel(struct detgeom *dg, const char * extern void detgeom_show_hierarchy(const struct detgeom *dg); +extern void detgeom_translate_detector_m(struct detgeom *dg, double x, double y, double z); + #ifdef __cplusplus } #endif |