From 396c424b561966259467c8ab7fd31d133f209562 Mon Sep 17 00:00:00 2001 From: Valerio Mariani Date: Fri, 28 Nov 2014 14:37:33 +0100 Subject: Remove twod_mapping function --- libcrystfel/src/integration.c | 127 ------------------------------------------ 1 file changed, 127 deletions(-) (limited to 'libcrystfel/src/integration.c') diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index 05060f70..4a743c63 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -1209,133 +1209,6 @@ static int suitable_reference(struct intcontext *ic, struct peak_box *bx) } -static void add_to_rg_matrix(struct intcontext *ic, struct panel *p, - gsl_matrix *M, gsl_vector *vx, gsl_vector *vy, - int *pn) -{ - int i; - - for ( i=0; in_boxes; i++ ) { - - double x, y, w; - double fs, ss; - double offs_x, offs_y; - - if ( ic->boxes[i].p != p ) continue; - - fs = ic->boxes[i].cfs + ic->halfw; - ss = ic->boxes[i].css + ic->halfw; - - twod_mapping(fs, ss, &x, &y, ic->boxes[i].p); - - w = ic->boxes[i].intensity; - - addm(M, 0, 0, w*fs*fs); - addm(M, 0, 1, w*fs*ss); - addm(M, 0, 2, w*fs); - addm(M, 1, 0, w*fs*ss); - addm(M, 1, 1, w*ss*ss); - addm(M, 1, 2, w*ss); - addm(M, 2, 0, w*fs); - addm(M, 2, 1, w*ss); - addm(M, 2, 2, w); - - /* Offsets in lab coordinate system */ - offs_x = p->fsx * ic->boxes[i].offs_fs - + p->ssx * ic->boxes[i].offs_ss; - - offs_y = p->fsy * ic->boxes[i].offs_fs - + p->ssy * ic->boxes[i].offs_ss; - - addv(vx, 0, w*offs_x*fs); - addv(vx, 1, w*offs_x*ss); - addv(vx, 2, w*offs_x); - - addv(vy, 0, w*offs_y*fs); - addv(vy, 1, w*offs_y*ss); - addv(vy, 2, w*offs_y); - - (*pn)++; - } -} - - -static void UNUSED refine_rigid_groups(struct intcontext *ic) -{ - int i; - - for ( i=0; iimage->det->n_rigid_groups; i++ ) { - - struct rigid_group *rg; - gsl_matrix *M; - gsl_vector *vx; - gsl_vector *vy; - gsl_vector *dq1; - gsl_vector *dq2; - int j; - int n; - - M = gsl_matrix_calloc(3, 3); - if ( M == NULL ) { - ERROR("Failed to allocate matrix\n"); - return; - } - - vx = gsl_vector_calloc(3); - if ( vx == NULL ) { - ERROR("Failed to allocate vector\n"); - return; - } - - vy = gsl_vector_calloc(3); - if ( vy == NULL ) { - ERROR("Failed to allocate vector\n"); - return; - } - - rg = ic->image->det->rigid_groups[i]; - - n = 0; - for ( j=0; jn_panels; j++ ) { - add_to_rg_matrix(ic, rg->panels[j], M, vx, vy, &n); - } - - if ( n > 10 ) { - - dq1 = solve_svd(vx, M); - dq2 = solve_svd(vy, M); - - rg->d_fsx = gsl_vector_get(dq1, 0); - rg->d_ssx = gsl_vector_get(dq1, 1); - rg->d_cnx = gsl_vector_get(dq1, 2); - rg->d_fsy = gsl_vector_get(dq2, 0); - rg->d_ssy = gsl_vector_get(dq2, 1); - rg->d_cny = gsl_vector_get(dq2, 2); - rg->have_deltas = 1; - - gsl_vector_free(dq1); - gsl_vector_free(dq2); - - } else { - - rg->d_fsx = 0.0; - rg->d_ssx = 0.0; - rg->d_cnx = 0.0; - rg->d_fsy = 0.0; - rg->d_ssy = 0.0; - rg->d_cny = 0.0; - rg->have_deltas = 0; - - } - - gsl_vector_free(vx); - gsl_vector_free(vy); - gsl_matrix_free(M); - - } -} - - static int get_int_diag(struct intcontext *ic, Reflection *refl) { if ( ic->int_diag == INTDIAG_NONE ) return 0; -- cgit v1.2.3