diff options
author | Thomas White <taw@physics.org> | 2023-07-13 17:19:59 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-07-28 13:22:05 +0200 |
commit | dfec026facffd86fe5ce503037180e91f417fed0 (patch) | |
tree | bc3e3803e7d9889972ac478117be394b6801cc74 | |
parent | a3480ec447f420a49bdf89f80a500c0dc3aecc2e (diff) |
align_detector: Set up Millepede steering file for specified refinement level
-rw-r--r-- | src/align_detector.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/align_detector.c b/src/align_detector.c index c6e73497..1c273aee 100644 --- a/src/align_detector.c +++ b/src/align_detector.c @@ -38,6 +38,8 @@ #include <datatemplate.h> #include <utils.h> +#include <predict-refine.h> +#include <crystfel-mille.h> #include "version.h" @@ -71,6 +73,9 @@ int main(int argc, char *argv[]) char *rval; int i; FILE *fh; + DataTemplate *dtempl; + struct dg_group_info *groups; + int n_groups; /* Long options */ const struct option longopts[] = { @@ -148,9 +153,21 @@ int main(int argc, char *argv[]) fprintf(fh, "%s\n", argv[i]); } - fprintf(fh, "Parameter\n"); - fprintf(fh, "1 0 0\n"); - fprintf(fh, "2 0 0\n"); + dtempl = data_template_new_from_file(in_geom); + groups = data_template_group_info(dtempl, &n_groups); + + fprintf(fh, "\nParameter\n"); + for ( i=0; i<n_groups; i++ ) { + int f = (groups[i].hierarchy_level > level) ? -1 : 0; + fprintf(fh, "%i 0 %i\n", mille_label(groups[i].serial, GPARAM_DET_TX), f); + fprintf(fh, "%i 0 %i\n", mille_label(groups[i].serial, GPARAM_DET_TY), f); + fprintf(fh, "%i 0 %i\n", mille_label(groups[i].serial, GPARAM_DET_TZ), f); + fprintf(fh, "%i 0 %i\n", mille_label(groups[i].serial, GPARAM_DET_RX), f); + fprintf(fh, "%i 0 %i\n", mille_label(groups[i].serial, GPARAM_DET_RY), f); + fprintf(fh, "%i 0 %i\n", mille_label(groups[i].serial, GPARAM_DET_RZ), f); + } + fprintf(fh, "\n"); + fprintf(fh, "method inversion 5 0.1\n"); fprintf(fh, "end\n"); fclose(fh); |