def test_basex_zeros_asym(): n = 21 x = np.zeros((n, n), dtype="float32") bs = get_bs_basex_cached_asym(n, n, basis_dir=None, verbose=False) recon = basex_transform_asym(x, *bs) assert_allclose(recon, 0)
def test_basex_shape_asym(): n = 21 x = np.ones((n, n), dtype="float32") bs = get_bs_basex_cached_asym(n, n, basis_dir=None, verbose=False) recon = basex_transform_asym(x, *bs) assert recon.shape == (n, n)
def test_basex_zeros_asym(): n = 21 x = np.zeros((n, n), dtype='float32') bs = get_bs_basex_cached_asym(n, n, basis_dir=None, verbose=False) recon = basex_transform_asym(x, *bs) assert_allclose(recon, 0)
def test_basex_shape_asym(): n = 21 x = np.ones((n, n), dtype='float32') bs = get_bs_basex_cached_asym(n, n, basis_dir=None, verbose=False) recon = basex_transform_asym(x, *bs) assert recon.shape == (n, n)
def test_basex_step_ratio_asym(): """Check a gaussian solution for asymmetric BASEX""" n = 51 r_max = 25 ref = GaussianAnalytical(n, r_max, symmetric=True, sigma=10) tr = np.tile(ref.abel[None, :], (n, 1)) # make a 2D array from 1D bs = get_bs_basex_cached_asym(n, n, basis_dir=None, verbose=False) recon = basex_transform_asym(tr, *bs) recon1d = recon[n // 2 + n % 2] ratio = absolute_ratio_benchmark(ref, recon1d) assert_allclose(ratio, 1.0, rtol=3e-2, atol=0)