aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/detgeom.c12
-rw-r--r--libcrystfel/src/detgeom.h2
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