diff options
author | Thomas White <taw@bitwiz.org.uk> | 2013-05-30 14:39:08 -0700 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2013-05-30 14:39:08 -0700 |
commit | 72785601600f3cea06c5391e1ee7be80872500c2 (patch) | |
tree | cdc051f63ecb0d1adc0e806eaccf377b9a5d065b /libcrystfel | |
parent | a60943693a3290c339782e1ccd45b380e2393508 (diff) |
Include initial centering offset in stream
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/integration.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index 3affd1ab..65567b1e 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -896,6 +896,9 @@ static int center_and_check_box(struct intcontext *ic, struct peak_box *bx, { int i; + bx->offs_fs = 0.0; + bx->offs_ss = 0.0; + if ( check_box(ic, bx, sat) ) return 1; for ( i=0; i<10; i++ ) { @@ -907,6 +910,7 @@ static int center_and_check_box(struct intcontext *ic, struct peak_box *bx, int t_offs_fs = 0; int t_offs_ss = 0; double offs_fs, offs_ss; + int ifs, iss; for ( p=0; p<ic->w; p++ ) { for ( q=0; q<ic->w; q++ ) { @@ -925,8 +929,12 @@ static int center_and_check_box(struct intcontext *ic, struct peak_box *bx, offs_fs = sum_fs / den; offs_ss = sum_ss / den; - bx->cfs += rint(offs_fs); - bx->css += rint(offs_ss); + ifs = rint(offs_fs); + iss = rint(offs_ss); + bx->offs_fs += ifs; + bx->offs_ss += iss; + bx->cfs += ifs; + bx->css += iss; t_offs_fs += rint(offs_fs); t_offs_ss += rint(offs_fs); @@ -1496,8 +1504,9 @@ static void integrate_box(struct intcontext *ic, struct peak_box *bx, } } - bx->offs_fs = (double)fsct / pk_total; - bx->offs_ss = (double)ssct / pk_total; + /* This offset is in addition to the offset from center_and_check_box */ + bx->offs_fs += (double)fsct / pk_total; + bx->offs_ss += (double)ssct / pk_total; var = pk_counts * bg_var; var += aduph * pk_total; |