Esempio n. 1
0
        public void TestGetIPsForCell360()
        {
            var a = new LinearCycledLonsAvgProcessing(Build360Axis(), false);

            var ips = a.GetIPsForCell(4.0, 6.0);

            Assert.AreEqual(3, ips.Indices.Length);
            Assert.AreEqual(4, ips.Indices[0]);
            Assert.AreEqual(5, ips.Indices[1]);
            Assert.AreEqual(6, ips.Indices[2]);

            ips = a.GetIPsForCell(358.0, 360.0);
            Assert.AreEqual(3, ips.Indices.Length);
            Assert.AreEqual(358, ips.Indices[0]);
            Assert.AreEqual(359, ips.Indices[1]);
            Assert.AreEqual(0, ips.Indices[2]);

            ips = a.GetIPsForCell(-120.4, -120.2);
            Assert.AreEqual(2, ips.Indices.Length);
            Assert.AreEqual(239, ips.Indices[0]);
            Assert.AreEqual(240, ips.Indices[1]);

            ips = a.GetIPsForCell(10, 5);
            Assert.AreEqual(356, ips.Indices.Length);

            ips = a.GetIPsForCell(-0.2, -0.4);
            Assert.AreEqual(362, ips.Indices.Length);
        }
Esempio n. 2
0
        public void TestIndecesForRepeatedNodesAtBoundares()
        {
            var a   = new LinearCycledLonsAvgProcessing(Build360AxisBoundariesRepeated(), true);
            var ips = a.GetIPsForPoint(3.5);

            Assert.AreEqual(2, ips.Indices.Length);
            Assert.AreEqual(3, ips.Indices[0]);
            Assert.AreEqual(4, ips.Indices[1]);

            ips = a.GetIPsForPoint(-0.5);
            Assert.AreEqual(2, ips.Indices.Length);
            Assert.AreEqual(359, ips.Indices[0]);
            Assert.IsTrue(0 == ips.Indices[1] || 360 == ips.Indices[1]);

            ips = a.GetIPsForPoint(-1.5);
            Assert.AreEqual(2, ips.Indices.Length);
            Assert.AreEqual(358, ips.Indices[0]);
            Assert.AreEqual(359, ips.Indices[1]);

            ips = a.GetIPsForCell(-0.5, 0.5);
            Assert.AreEqual(3, ips.Indices.Length);
            Assert.AreEqual(359, ips.Indices[0]);
            Assert.IsTrue(0 == ips.Indices[1] || 360 == ips.Indices[1]);
            Assert.AreEqual(1, ips.Indices[2]);
        }
Esempio n. 3
0
        public void TestGetIPsForCell180()
        {
            var a = new LinearCycledLonsAvgProcessing(Build180Axis(), false);

            var ips = a.GetIPsForCell(4.0, 6.0);

            Assert.AreEqual(3, ips.Indices.Length);
            Assert.AreEqual(184, ips.Indices[0]);
            Assert.AreEqual(185, ips.Indices[1]);
            Assert.AreEqual(186, ips.Indices[2]);

            ips = a.GetIPsForCell(178.0, 180.0);
            Assert.AreEqual(3, ips.Indices.Length);
            Assert.AreEqual(358, ips.Indices[0]);
            Assert.AreEqual(359, ips.Indices[1]);
            Assert.AreEqual(0, ips.Indices[2]);

            ips = a.GetIPsForCell(270.2, 270.6);
            Assert.AreEqual(2, ips.Indices.Length);
            Assert.AreEqual(90, ips.Indices[0]);
            Assert.AreEqual(91, ips.Indices[1]);
        }