From 8509b13f168c1fc3301da4abe3f70df1c7e37690 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 13 Mar 2018 09:21:41 +0100 Subject: [PATCH] avoid numerical noise --- src/math.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math.f90 b/src/math.f90 index 0c6f427ab..8eac3e304 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -1779,7 +1779,7 @@ function math_sampleGaussOri(center,FWHM) real(pReal), dimension(3,3) :: R if (FWHM < 0.1_pReal*INRAD) then - R = math_I3 + math_sampleGaussOri = center else GaussConvolution: do rnd = halton([8_pInt,3_pInt,6_pInt,11_pInt]) @@ -1791,9 +1791,9 @@ function math_sampleGaussOri(center,FWHM) angle = math_EulerMisorientation([0.0_pReal,0.0_pReal,0.0_pReal],math_RtoEuler(R)) if (rnd(4) <= exp(-4.0_pReal*log(2.0_pReal)*(angle/FWHM)**2_pReal)) exit ! rejection sampling (Gaussian) enddo GaussConvolution + math_sampleGaussOri = math_RtoEuler(math_mul33x33(R,math_EulerToR(center))) endif - math_sampleGaussOri = math_RtoEuler(math_mul33x33(R,math_EulerToR(center))) end function math_sampleGaussOri