예제 #1
0
        public void Hto()
        {
            var man  = new HealpixManager(2);
            var data = new BasinData(man, false, true);

            foreach (var aBasin in data.PixMan.Pixels)
            {
                Assert.AreEqual(0, aBasin.hOQ);
            }
            data.GradientAndHeightCrosses();

            var basin = data.PixMan.Pixels[(int)(man.Npix * .415)]; // 79 for k2, 20398 for k6

            Assert.AreEqual(96, basin.Hto[0] / 1000, 1);
            Assert.AreEqual(90, basin.Hto[1] / 1000, 1);
            TestNeighbors(basin);
            foreach (var aBasin in data.PixMan.Pixels)
            {
                if (aBasin != basin &&
                    !(from n in basin.Neibors.Cast <Basin3>()
                      where n == aBasin
                      select n).Any())
                {
                    Assert.AreEqual(0, aBasin.hOQ);
                }
            }

            basin = data.PixMan.Pixels[63];
            Assert.AreEqual(109, basin.Hto[0] / 1000, 1);
            Assert.AreEqual(96, basin.Hto[1] / 1000, 1);
            TestNeighbors(basin);
            basin = data.PixMan.Pixels[47];
            Assert.AreEqual(137, basin.Hto[0] / 1000, 1);
            Assert.AreEqual(109, basin.Hto[1] / 1000, 1);
            TestNeighbors(basin);
            basin = data.PixMan.Pixels[31];
            Assert.AreEqual(156, basin.Hto[0] / 1000, 1);
            Assert.AreEqual(137, basin.Hto[1] / 1000, 1);
            TestNeighbors(basin);

            basin = data.PixMan.Pixels[17];
            Assert.AreEqual(145, basin.Hto[0] / 1000, 1);
            Assert.AreEqual(156, basin.Hto[1] / 1000, 1);
            TestNeighbors(basin);
            basin = data.PixMan.Pixels[7];
            Assert.AreEqual(139, basin.Hto[0] / 1000, 1);
            Assert.AreEqual(145, basin.Hto[1] / 1000, 1);
            TestNeighbors(basin);
        }
예제 #2
0
        public void Hto_SameRing()
        {
            var data = new BasinData(new HealpixManager(2), false, true);

            foreach (var aBasin in data.PixMan.Pixels)
            {
                Assert.AreEqual(0, aBasin.hOQ);
            }
            data.GradientAndHeightCrosses();

            for (var p = 43; p <= 50; p++)
            {
                var basin = data.PixMan.Pixels[p];
                Assert.AreEqual(137494, basin.Hto[0], 1);
                Assert.AreEqual(108624, basin.Hto[1], 1);
                TestNeighbors(basin);
            }
        }