aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/detector.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/detector.c b/src/detector.c
index 96646dc1..7f29ec82 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -1183,3 +1183,52 @@ void get_pixel_extents(struct detector *det,
}
}
+
+
+int write_detector_geometry(const char *filename, struct detector *det)
+{
+ struct panel *p;
+ int pi;
+ FILE *fh;
+
+ if ( filename == NULL ) return 2;
+ if ( det->n_panels < 1 ) return 3;
+
+ fh = fopen(filename, "w");
+ if ( fh == NULL ) return 1;
+
+ for ( pi=0; pi<det->n_panels; pi++) {
+
+ p = &(det->panels[pi]);
+
+ if ( p == NULL ) return 4;
+
+ if ( pi > 0 ) fprintf(fh, "\n");
+
+ fprintf(fh, "%s/min_fs = %d\n", p->name, p->min_fs);
+ fprintf(fh, "%s/min_ss = %d\n", p->name, p->min_ss);
+ fprintf(fh, "%s/max_fs = %d\n", p->name, p->max_fs);
+ fprintf(fh, "%s/max_ss = %d\n", p->name, p->max_ss);
+ fprintf(fh, "%s/badrow_direction = %C\n", p->name, p->badrow);
+ fprintf(fh, "%s/res = %g\n", p->name, p->res);
+ fprintf(fh, "%s/peak_sep = %g\n", p->name, p->peak_sep);
+ fprintf(fh, "%s/clen = %s\n", p->name, p->clen_from);
+ fprintf(fh, "%s/fs = %+fx %+fy\n", p->name, p->fsx, p->fsy);
+ fprintf(fh, "%s/ss = %+fx %+fy\n", p->name, p->ssx, p->ssy);
+ fprintf(fh, "%s/corner_x = %g\n", p->name, p->cnx);
+ fprintf(fh, "%s/corner_y = %g\n", p->name, p->cny);
+
+ if ( p->no_index ) {
+ fprintf(fh, "%s/no_index = 1\n", p->name);
+ } /* else don't clutter up the file */
+
+ if ( p->rigid_group != NULL ) {
+ fprintf(fh, "%s/rigid_group = %s\n",
+ p->name, p->rigid_group);
+ }
+
+ }
+ fclose(fh);
+
+ return 0;
+}