aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/detector.c13
-rw-r--r--libcrystfel/src/detector.h3
-rw-r--r--libcrystfel/src/integration.c127
3 files changed, 0 insertions, 143 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 09eb964d..e148cb59 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -1480,19 +1480,6 @@ struct detector *simple_geometry(const struct image *image)
}
-void twod_mapping(double fs, double ss, double *px, double *py,
- struct panel *p)
-{
- double xs, ys;
-
- xs = fs*p->fsx + ss*p->ssx;
- ys = fs*p->fsy + ss*p->ssy;
-
- *px = xs + p->cnx;
- *py = ys + p->cny;
-}
-
-
int reverse_2d_mapping(double x, double y, double *pfs, double *pss,
struct detector *det)
{
diff --git a/libcrystfel/src/detector.h b/libcrystfel/src/detector.h
index 9ad90e05..f43df2cc 100644
--- a/libcrystfel/src/detector.h
+++ b/libcrystfel/src/detector.h
@@ -209,9 +209,6 @@ extern void fill_in_values(struct detector *det, struct hdfile *f,
extern struct detector *copy_geom(const struct detector *in);
-extern void twod_mapping(double fs, double ss, double *px, double *py,
- struct panel *p);
-
extern int reverse_2d_mapping(double x, double y, double *pfs, double *pss,
struct detector *det);
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; i<ic->n_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; i<ic->image->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; j<rg->n_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;