diff options
author | Thomas White <taw@physics.org> | 2023-08-30 17:14:21 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-08-30 17:14:21 +0200 |
commit | 63111bd3c29a20657f301601330acf70b3de42a1 (patch) | |
tree | 2193e20f133349fe9643f677407b88dd25a36d40 | |
parent | 4b1ad5c62bfd203503a68b136453c810ba1bb11f (diff) |
Add excitation error to Millepede data (local-only measurement)
-rw-r--r-- | libcrystfel/src/crystfel-mille.c | 7 | ||||
-rw-r--r-- | libcrystfel/src/predict-refine.c | 5 | ||||
-rw-r--r-- | libcrystfel/src/predict-refine.h | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/libcrystfel/src/crystfel-mille.c b/libcrystfel/src/crystfel-mille.c index fd957693..6a80e323 100644 --- a/libcrystfel/src/crystfel-mille.c +++ b/libcrystfel/src/crystfel-mille.c @@ -186,6 +186,7 @@ void write_mille(Mille *mille, int n, UnitCell *cell, float local_gradients_fs[nl]; float local_gradients_ss[nl]; + float local_gradients_r[nl]; float global_gradients_fs[ng*max_hierarchy_levels]; float global_gradients_ss[ng*max_hierarchy_levels]; int labels[ng*max_hierarchy_levels]; @@ -199,6 +200,8 @@ void write_mille(Mille *mille, int n, UnitCell *cell, Minvs[rps[i].peak->pn], 0, 0, 0, &local_gradients_fs[j], &local_gradients_ss[j]); + local_gradients_r[j] = EXC_WEIGHT * r_gradient(rvl[j], rps[i].refl, + cell, image->lambda); } /* Global gradients for each hierarchy level, starting at the @@ -243,6 +246,10 @@ void write_mille(Mille *mille, int n, UnitCell *cell, nl, local_gradients_ss, j, global_gradients_ss, labels, ss_dev(&rps[i], image->detgeom), 0.22); + + /* Add excitation error "measurement" (local-only) */ + mille_add_measurement(mille, nl, local_gradients_r, + 0, NULL, NULL, r_dev(&rps[i])*EXC_WEIGHT, 1.0); } } diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c index 58bf3580..4fdccef4 100644 --- a/libcrystfel/src/predict-refine.c +++ b/libcrystfel/src/predict-refine.c @@ -45,11 +45,6 @@ /** \file predict-refine.h */ - -/* Weighting of excitation error term (m^-1) compared to position term (pixels) */ -#define EXC_WEIGHT (0.5e-7) - - double r_dev(struct reflpeak *rp) { /* Excitation error term */ diff --git a/libcrystfel/src/predict-refine.h b/libcrystfel/src/predict-refine.h index 604799c0..1e72a048 100644 --- a/libcrystfel/src/predict-refine.h +++ b/libcrystfel/src/predict-refine.h @@ -53,6 +53,10 @@ enum gparam { }; +/* Weighting of excitation error term (m^-1) compared to position term (pixels) */ +#define EXC_WEIGHT (0.5e-7) + + #include "crystal.h" #include "crystfel-mille.h" |