def test_projection(): ds = setup_cluster() nx,ny,nz = ds.domain_dimensions xinit = np.array(1.0e9*hcgs*freqs/(kboltz*Tcmb)) szprj = SZProjection(ds, freqs, mue=mue, high_order=True) szprj.on_axis(2, nx=nx) deltaI = np.zeros((3,nx,ny)) for i in range(3): deltaI[i,:,:] = full_szpack3d(ds, xinit[i]) yield assert_almost_equal, deltaI[i,:,:], np.array(szprj["%d_GHz" % int(freqs[i])]), 6
def test_projection(): ds = setup_cluster() nx, ny, nz = ds.domain_dimensions xinit = np.array(1.0e9 * hcgs * freqs / (kboltz * Tcmb)) szprj = SZProjection(ds, freqs, mue=mue, high_order=True) szprj.on_axis(2, nx=nx) deltaI = np.zeros((3, nx, ny)) for i in range(3): deltaI[i, :, :] = full_szpack3d(ds, xinit[i]) yield assert_almost_equal, deltaI[i, :, :], np.array( szprj["%d_GHz" % int(freqs[i])]), 6
def test_M7_offaxis(): ds = data_dir_load(M7) szprj = SZProjection(ds, freqs) szprj.off_axis(np.array([0.1,-0.2,0.4]), nx=100) def offaxis_array_func(): return szprj.data def offaxis_image_func(filename_prefix): szprj.write_png(filename_prefix) for test in [GenericArrayTest(ds, offaxis_array_func), GenericImageTest(ds, offaxis_image_func, 3)]: test_M7_offaxis.__name__ = test.description yield test
def test_M7_offaxis(): ds = data_dir_load(M7) szprj = SZProjection(ds, freqs) szprj.off_axis(np.array([0.1,-0.2,0.4]), nx=100) def offaxis_array_func(): return szprj.data def offaxis_image_func(filename_prefix): szprj.write_png(filename_prefix) for test in [GenericArrayTest(ds, offaxis_array_func), GenericImageTest(ds, offaxis_image_func, 12)]: test_M7_offaxis.__name__ = test.description yield test