From 89411b3b07a795e49b1c80e56f5cf6304f33ac57 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 17 Jun 2015 10:44:39 +0200 Subject: Small tidying up for asdf --- libcrystfel/src/asdf.c | 59 +++++--------------------------------------------- 1 file changed, 6 insertions(+), 53 deletions(-) diff --git a/libcrystfel/src/asdf.c b/libcrystfel/src/asdf.c index d28fcf6a..345bd32c 100644 --- a/libcrystfel/src/asdf.c +++ b/libcrystfel/src/asdf.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "image.h" @@ -56,7 +57,7 @@ struct fftw_vars fftw_vars_new() } -static int fftw_vars_free(struct fftw_vars fftw) +static void fftw_vars_free(struct fftw_vars fftw) { fftw_free(fftw.in); fftw_free(fftw.out); @@ -102,16 +103,6 @@ static int tvector_free(struct tvector t) } -static int tvector_memcpy(struct tvector *dest, struct tvector *src, int n) -{ - gsl_vector_memcpy(dest->t, src->t); - dest->n = src->n; - memcpy(dest->fits, src->fits, sizeof(int) * n); - - return 1; -} - - static int asdf_cell_free(struct asdf_cell *c) { int i; @@ -364,12 +355,11 @@ static float find_ds_fft(double *projections, int N_projections, double d_max, fftw_complex *out = fftw.out; fftw_plan p = fftw.p; - for ( i = 0; i < N; i++ ) { + for ( i=0; i max) { max = a; @@ -504,37 +494,6 @@ static int check_refl_fitting_cell(struct asdf_cell *c, } -static void print_asdf_cell(struct asdf_cell *cc) -{ - double a, b, c, alpha, beta, gamma, ab, bc, ca; - - a = gsl_blas_dnrm2(cc->axes[0]); - b = gsl_blas_dnrm2(cc->axes[1]); - c = gsl_blas_dnrm2(cc->axes[2]); - - gsl_blas_ddot(cc->axes[0], cc->axes[1], &ab); - gsl_blas_ddot(cc->axes[1], cc->axes[2], &bc); - gsl_blas_ddot(cc->axes[0], cc->axes[2], &ca); - - alpha = acos(bc/b/c)/M_PI*180; - beta = acos(ca/a/c)/M_PI*180; - gamma = acos(ab/a/b)/M_PI*180; - - //~ int i, j; - //~ for (i = 0; i < 3; i ++) { - //~ for (j = 0; j < 3; j ++) { - //~ printf("%f ", gsl_vector_get(cc.axes[i], j)); - //~ } - //~ printf("\n"); - //~ } - - printf("%.2f %.2f %.2f %.2f %.2f %.2f %.0f %d \n", a, b, c, - alpha, beta, gamma, - cc->volume, cc->n); - -} - - /* Returns 0 when refinement doesn't converge (i.e. all fitting reflections * lie in the same plane) */ static int refine_asdf_cell(struct asdf_cell *c, gsl_vector **reflections, @@ -749,6 +708,8 @@ static int find_acl(struct tvector t1, struct tvector t2, struct tvector t3) if ( i <= j && i <= k ) return i; if ( j <= i && j <= k ) return j; if ( k <= i && k <= j ) return k; + ERROR("This point never reached!\n"); + abort(); } @@ -896,14 +857,6 @@ static void shuffle_triplets(int **triplets, int n) } -static double angle_between_gsl(gsl_vector *a, gsl_vector *b) -{ - double ab; - gsl_blas_ddot(a, b, &ab); - return acos(ab/gsl_blas_dnrm2(a)/gsl_blas_dnrm2(b)) * 180 / M_PI; -} - - static int index_refls(gsl_vector **reflections, int N_reflections, double d_max, double volume_min, double volume_max, double LevelFit, double IndexFit, int i_max, -- cgit v1.2.3