Example #1
0
    def test_bottom_crossing(self):
        pts_on_axis = [[0, 0, z] for z in range(1, 1000)]
        for pt in pts_on_axis:
            cross_u = get_bottom_crossing(pt, "u")
            assumed_u = [
                WIRE.y_min, pt[2] + WIRE.y_min / np.tan(np.deg2rad(30))
            ]
            assert_almost_equal(cross_u, assumed_u)

            cross_v = get_bottom_crossing(pt, "v")
            assumed_v = [
                WIRE.y_min, pt[2] + WIRE.y_min / np.tan(np.deg2rad(-30))
            ]
            assert_almost_equal(cross_v, assumed_v)
Example #2
0
    def test_nearest_z500_y100(self):
        """
            |-----------------------------------------------------|
            |                          o                          |
            |                         / \                         |
          y |                        /   \                        |
            |                       /     \                       |
            |                      /       \                      |
            |---------------------/---------\---------------------|
                                        z
        """
        xyz = [0., 100., 500.]
        col_idx, col_start, u_idx, u_start, v_idx, v_start = nearest_wire(
            xyz, return_start=True)

        u_crossing_botm = get_bottom_crossing(xyz, "u")
        v_crossing_botm = get_bottom_crossing(xyz, "v")

        assert (np.allclose(u_start, u_crossing_botm, atol=0.6))
        assert (np.allclose(v_start, v_crossing_botm, atol=0.6))
Example #3
0
    def test_nearest_z1000_y0(self):
        """
            |-----------------------------------------------------|
            |                                                     |
            |                                                     |
          y |                                                   o |
            |                                                  / \|
            |                                                 /   |
            |------------------------------------------------/----|
                                        z
        """
        xyz = [0., 0., 1033.]
        col_idx, col_start, u_idx, u_start, v_idx, v_start = nearest_wire(
            xyz, return_start=True)

        u_crossing_botm = get_bottom_crossing(xyz, "u")
        v_crossing_side = get_side_corssing(xyz, "v")

        assert (np.allclose(u_start, u_crossing_botm, atol=0.6))
        assert (np.allclose(v_start, v_crossing_side, atol=0.6))