def test_hpxmap_interp_by_coord(nside, nested, coordsys, region, axes): m = HpxNDMap( HpxGeom(nside=nside, nest=nested, coordsys=coordsys, region=region, axes=axes)) coords = m.geom.get_coord(flat=True) m.set_by_coord(coords, coords[1]) assert_allclose(m.get_by_coord(coords), m.interp_by_coord(coords, interp="linear"))
def test_hpxmap_swap_scheme(nside, nested, coordsys, region, axes): m = HpxNDMap( HpxGeom(nside=nside, nest=nested, coordsys=coordsys, region=region, axes=axes)) fill_poisson(m, mu=1.0, random_state=0) m2 = m.to_swapped() coords = m.geom.get_coord(flat=True) assert_allclose(m.get_by_coord(coords), m2.get_by_coord(coords))
def test_hpxmap_swap_scheme(nside, nested, frame, region, axes): m = HpxNDMap( HpxGeom(nside=nside, nest=nested, frame=frame, region=region, axes=axes)) m.data = np.arange(m.data.size).reshape(m.geom.data_shape) m2 = m.to_swapped() coords = m.geom.get_coord(flat=True) assert_allclose(m.get_by_coord(coords), m2.get_by_coord(coords))