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)
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)
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))
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))