コード例 #1
0
ファイル: particle_map.py プロジェクト: FXIhub/condor
 def _get_map_icosahedron(self, radius, dx):
     # icosahedon size parameter
     a = radius*(16*numpy.pi/5.0/(3+numpy.sqrt(5)))**(1/3.0)
     # radius at corners in meter
     Rmax = numpy.sqrt(10.0+2*numpy.sqrt(5))*a/4.0 
     # radius at corners in pixel
     nRmax = Rmax/dx 
     # leaving a bit of free space around icosahedron 
     N = int(numpy.ceil(2.3*(nRmax)))
     log_info(logger,"Building icosahedron with radius %e (%i pixel) in %i x %i x %i voxel cube." % (radius,nRmax,N,N,N))
     m = condor.utils.bodies.make_icosahedron_map(N,nRmax)
     return numpy.asarray(m, dtype=numpy.float64)
コード例 #2
0
 def _get_map_icosahedron(self, radius, dx):
     # icosahedon size parameter
     a = radius * (16 * numpy.pi / 5.0 / (3 + numpy.sqrt(5)))**(1 / 3.0)
     # radius at corners in meter
     Rmax = numpy.sqrt(10.0 + 2 * numpy.sqrt(5)) * a / 4.0
     # radius at corners in pixel
     nRmax = Rmax / dx
     # leaving a bit of free space around icosahedron
     N = int(numpy.ceil(2.3 * (nRmax)))
     log_info(
         logger,
         "Building icosahedron with radius %e (%i pixel) in %i x %i x %i voxel cube."
         % (radius, nRmax, N, N, N))
     m = condor.utils.bodies.make_icosahedron_map(N, nRmax)
     return numpy.asarray(m, dtype=numpy.float64)
コード例 #3
0
 def _get_next_particles(self):
     D_particles = {}
     while len(D_particles) == 0:
         i = 0
         for p in self.particles.values():
             n = p.get_next_number_of_particles()
             for i_n in range(n):
                 D_particles["particle_%02i" % i] = p.get_next()
                 i += 1
         N = len(D_particles) 
         if N == 0:
             log_info(logger, "Miss - no particles in the interaction volume. Shooting again...")
         else:
             log_debug(logger, "%i particles" % N)
     return D_particles
コード例 #4
0
 def _get_next_particles(self):
     D_particles = {}
     while len(D_particles) == 0:
         i = 0
         for p in self.particles.values():
             n = p.get_next_number_of_particles()
             for i_n in range(n):
                 D_particles["particle_%02i" % i] = p.get_next()
                 i += 1
         N = len(D_particles) 
         if N == 0:
             log_info(logger, "Miss - no particles in the interaction volume. Shooting again...")
         else:
             log_debug(logger, "%i particles" % N)
     return D_particles