diff options
author | Thomas White <taw@physics.org> | 2017-10-25 16:26:58 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-02-27 17:12:41 +0100 |
commit | 3d72da334021b426710cf214001a19c54358170c (patch) | |
tree | 64e1473ede23e18dcb338cf408394366d411d096 | |
parent | 827c3a1a6bdc5680e240cf49e379c868d17c3e47 (diff) |
do_integral(): Take part of the filename as input for debug
-rw-r--r-- | libcrystfel/src/geometry.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index 7f5e8635..20084476 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -512,7 +512,7 @@ static void set_random_partialities(Crystal *cryst) static double do_integral(double q2, double zl, double R, - double lambda, double sig, int verbose) + double lambda, double sig, char *verbose) { int i; double kmin, kmax, kstart, kfinis; @@ -578,7 +578,7 @@ static double do_integral(double q2, double zl, double R, if ( verbose ) { char fn[64]; - snprintf(fn, 63, "partial%i.graph", verbose); + snprintf(fn, 63, "partial%s.graph", verbose); fh = fopen(fn, "w"); fprintf(fh, " n p wavelength E P\n"); STATUS("Nominal k = %e m^-1\n", 1.0/lambda); @@ -695,8 +695,12 @@ static void ginn_spectrum_partialities(Crystal *cryst) R = r0 + m * sqrt(q2); - total = do_integral(q2, zl, R, lambda, sig, 0); - norm = do_integral(q2, -0.5*q2*lambda, R, lambda, sig, 0); + //char tmp[256]; + //snprintf(tmp, 255, "-%i,%i,%i", h, k, l); + char *tmp = NULL; + + total = do_integral(q2, zl, R, lambda, sig, tmp); + norm = do_integral(q2, -0.5*q2*lambda, R, lambda, sig, NULL); set_partiality(refl, total/norm); set_lorentz(refl, 1.0); @@ -704,8 +708,8 @@ static void ginn_spectrum_partialities(Crystal *cryst) if ( total > 2.0*norm ) { /* Error! */ STATUS("total > 2*norm!\n"); - do_integral(q2, zl, R, lambda, sig, 1); - do_integral(q2, -0.5*q2*lambda, R, lambda, sig, 2); + do_integral(q2, zl, R, lambda, sig, NULL); + do_integral(q2, -0.5*q2*lambda, R, lambda, sig, NULL); abort(); } |