aboutsummaryrefslogtreecommitdiff
path: root/src/detector.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-07 11:27:16 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:17 +0100
commit3397bab94d8c495ffdaf74ff7de6a47f5a32df1a (patch)
tree92c7d637716d7085302516d1bd930a523a1ab9e8 /src/detector.c
parentb6c119939fcd95041c48035b27ebceaa19a4812e (diff)
indexamajig: Use HDF5's camera length when requested
Diffstat (limited to 'src/detector.c')
-rw-r--r--src/detector.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/detector.c b/src/detector.c
index b9d91118..dfff82a3 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -550,6 +550,35 @@ void free_detector_geometry(struct detector *det)
}
+struct detector *copy_geom(const struct detector *in)
+{
+ struct detector *out;
+ int i;
+
+ out = malloc(sizeof(struct detector));
+ memcpy(out, in, sizeof(struct detector));
+
+ out->panels = malloc(out->n_panels * sizeof(struct panel));
+ memcpy(out->panels, in->panels, out->n_panels * sizeof(struct panel));
+
+ for ( i=0; i<out->n_panels; i++ ) {
+
+ struct panel *p;
+
+ p = &out->panels[i];
+
+ if ( p->clen_from != NULL ) {
+ /* Make a copy of the clen_from fields unique to this
+ * copy of the structure. */
+ p->clen_from = strdup(p->clen_from);
+ }
+
+ }
+
+ return out;
+}
+
+
struct detector *simple_geometry(const struct image *image)
{
struct detector *geom;