public void test_pixangpix() throws Exception { System.out.println("Testing identity pix2ang(ang2pix(i))==i"); int omax = HealpixBase.order_max; Random rng = new Random(5); for (int o = 0; o <= omax; ++o) { for (int m = 0; m < nsamples; ++m) { long pix = (long) (rng.nextDouble() * HealpixProc.order2Npix(o)); assertEquals( "pixangpix problem", pix, HealpixProc.ang2pixNest(o, HealpixProc.pix2angNest(o, pix))); assertEquals( "pixangpix problem", pix, HealpixProc.ang2pixRing(o, HealpixProc.pix2angRing(o, pix))); } } }
public void test() throws Exception { int o = 8; for (int i = 0; i < HealpixProc.order2Npix(o); ++i) { assertEquals( "pixel mismatch_nest", i, HealpixProc.ang2pixNest(o, HealpixProc.pix2angNest(o, i))); assertEquals( "pixel mismatch_nest", i, HealpixProc.vec2pixNest(o, HealpixProc.pix2vecNest(o, i))); assertEquals( "pixel mismatch_ring", i, HealpixProc.ang2pixRing(o, HealpixProc.pix2angRing(o, i))); assertEquals( "pixel mismatch_ring", i, HealpixProc.vec2pixRing(o, HealpixProc.pix2vecRing(o, i))); assertEquals( "pixel mismatch", i, HealpixProc.ring2nest(o, HealpixProc.ang2pixRing(o, HealpixProc.pix2angNest(o, i)))); assertEquals( "pixel mismatch_ringnestring", i, HealpixProc.ring2nest(o, HealpixProc.nest2ring(o, i))); } }
public void test_accuracy() throws Exception { System.out.println("Testing accuracy near the poles"); for (int order = 0; order <= HealpixBase.order_max; ++order) assertTrue("incorrect pix2ang", HealpixProc.pix2angRing(order, 1).theta > 0.0); }