コード例 #1
0
    def setUp(self):
        asm = homogenizer.rect_homogenizer(1., 1., 1.2, 1.)
        
        # 4 rays starting somewhat above (+z) the homogenizer
        pos = N.zeros((3,4))
        pos[2] = 1.5

        # One ray going to each wall, bearing down (-z):
        dir = N.c_[[1, 0, -1], [-1, 0, -1], [0, 1, -1], [0, -1, -1]]/N.sqrt(2)

        self.bund = RayBundle(pos, dir, ref_index=N.ones(4), energy=N.ones(4)*4.)
        self.engine = TracerEngine(asm)
コード例 #2
0
ファイル: test_tracer_tree.py プロジェクト: kraken22/Tracer
    def setUp(self):
        asm = homogenizer.rect_homogenizer(1., 1., 1.2, 1.)

        # 4 rays starting somewhat above (+z) the homogenizer
        pos = N.zeros((3, 4))
        pos[2] = 1.5

        # One ray going to each wall, bearing down (-z):
        dir = N.c_[[1, 0, -1], [-1, 0, -1], [0, 1, -1],
                   [0, -1, -1]] / N.sqrt(2)

        self.bund = RayBundle(pos,
                              dir,
                              ref_index=N.ones(4),
                              energy=N.ones(4) * 4.)
        self.engine = TracerEngine(asm)
コード例 #3
0
 def setUp(self):
     """A homogenizer transforms a bundle correctly"""
     hmg = rect_homogenizer(5., 3., 10., 0.9)
     self.engine = TracerEngine(hmg)
     self.bund = RayBundle()
     
     # 4 rays starting somewhat above (+z) the homogenizer
     pos = N.zeros((3,4))
     pos[2] = N.r_[11, 11, 11, 11]
     self.bund.set_vertices(pos)
     
     # One ray going to each wall:
     dir = N.c_[[1, 0, -1], [-1, 0, -1], [0, 1, -1], [0, -1, -1]]/N.sqrt(2)
     self.bund.set_directions(dir)
     
     # Laborious setup details:
     self.bund.set_energy(N.ones(4)*4.)
     self.bund.set_ref_index(N.ones(4))
コード例 #4
0
ファイル: test_homogenizer.py プロジェクト: pcacunar/Tracer
    def setUp(self):
        """A homogenizer transforms a bundle correctly"""
        hmg = rect_homogenizer(5., 3., 10., 0.9)
        self.engine = TracerEngine(hmg)
        self.bund = RayBundle()

        # 4 rays starting somewhat above (+z) the homogenizer
        pos = N.zeros((3, 4))
        pos[2] = N.r_[11, 11, 11, 11]
        self.bund.set_vertices(pos)

        # One ray going to each wall:
        dir = N.c_[[1, 0, -1], [-1, 0, -1], [0, 1, -1],
                   [0, -1, -1]] / N.sqrt(2)
        self.bund.set_directions(dir)

        # Laborious setup details:
        self.bund.set_energy(N.ones(4) * 4.)
        self.bund.set_ref_index(N.ones(4))