def test_fabel_hansenlaw_transform_gaussian(): """Check fabel_hansenlaw with a Gaussian function""" n = 1001 r_max = 501 # more points better fit ref = GaussianAnalytical(n, r_max, symmetric=False, sigma=200) recon = fabel_hansenlaw_transform(ref.func, ref.dr) ratio = absolute_ratio_benchmark(ref, recon, kind='direct') assert_allclose(ratio, 1.0, rtol=7e-2, atol=0)
def test_fabel_hansenlaw_transform_gaussian(): """Check fabel_hansenlaw with a Gaussian function""" n = 1001 r_max = 501 # more points better fit ref = GaussianAnalytical(n, r_max, symmetric=False, sigma=200) recon = fabel_hansenlaw_transform(ref.func, ref.dr) ratio = absolute_ratio_benchmark(ref, recon, kind='direct') assert_allclose(ratio, 1.0, rtol=7e-2, atol=0)
def test_fabel_hansenlaw_transform_curveA(): """ Check fabel_hansenlaw_transform() curve A """ delta = 0.01 # sample size # split r-domain to suit function pair rl = np.arange(0, 0.5 + delta / 2, delta) # 0 <= r <= 0.5 rr = np.arange(0.5 + delta, 1.0, delta) # 0.5 < r < 1.0 r = np.concatenate((rl, rr), axis=0) # whole r = [0,1) orig = np.concatenate((f(rl), f(rr)), axis=0) # f(r) proj = np.concatenate((g(rl), g(rr)), axis=0) # g(r) Aproj = fabel_hansenlaw_transform(orig, delta) # forward Abel # == g(r) assert_allclose(proj, Aproj, rtol=0, atol=6.0e-2)
def test_fabel_hansenlaw_transform_curveA(): """ Check fabel_hansenlaw_transform() curve A """ delta = 0.01 # sample size # split r-domain to suit function pair rl = np.arange(0, 0.5+delta/2, delta) # 0 <= r <= 0.5 rr = np.arange(0.5+delta, 1.0, delta) # 0.5 < r < 1.0 r = np.concatenate((rl,rr), axis=0) # whole r = [0,1) orig = np.concatenate((f(rl),f(rr)), axis=0) # f(r) proj = np.concatenate((g(rl),g(rr)), axis=0) # g(r) Aproj = fabel_hansenlaw_transform(orig, delta) # forward Abel # == g(r) assert_allclose(proj, Aproj, rtol=0, atol=6.0e-2)