From 7f2f2275e0d40873925d03075eae91f2bbba9ce3 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 10 Aug 2011 16:02:01 +0200 Subject: Simplify determination of axis length from FFT output --- src/reax.c | 50 +++++++++++--------------------------------------- 1 file changed, 11 insertions(+), 39 deletions(-) diff --git a/src/reax.c b/src/reax.c index 2985f121..a76e394e 100644 --- a/src/reax.c +++ b/src/reax.c @@ -102,56 +102,28 @@ static void walk_graph(double *x, double *y, double *z, int smin, int smax, fftw_complex *fft_out, int nel, double pmax, double modv_exp) { - int i, s, mult; + int i, s; double max, modv; - FILE *fh = fopen("fft.dat", "w"); - for ( i=0; i max ) { - max = m; - s = i; - } + if ( m > max ) { + max = m; + s = i; } - assert(s>0); - //STATUS("Estimated axis length:%.5f nm\n", - // (idx_to_m(s)/mult)*1e9); - - new_s = (double)s*(mult+1)/mult; - smin = new_s - 1; - smax = new_s + 1; - mult++; - - } while ( mult<5 ); + } + assert(s>0); modv = 2.0*pmax / (double)s; - modv *= mult-1; *x *= modv; *y *= modv; *z *= modv; - - //exit(1); } -- cgit v1.2.3