Discrete3DMeshRayTransferEmitter#
- class cherab.lhd.emc3.raytransfer.Discrete3DMeshRayTransferEmitter#
Bases:
InhomogeneousVolumeEmitterA unit emitter defined on a Discrete3DMesh class, which can be used to calculate ray transfer matrices (geometry matrices).
Note that for performance reason there are no boundary checks in
emission_function(), or inDiscrete3DMeshRayTransferIntegrator, so this emitter must be placed inside a bounding box.- Parameters:
- index_function
callable() Callable objects taking 3 positional arguments \((X, Y, Z)\).
- bins
int Number of bins for the spectral array, by default 0.
- integration_step
float,optional The length of line integration step, by default 0.01.
- integrator
VolumeIntegrator,optional Volume integrator, by default
Discrete3DMeshRayTransferIntegrator(integration_step).
- index_function
Examples
from numpy import hypot from raysect.optical import World, translate, Point3D from raysect.primitive import Cylinder from cherab.lhd.emc3.raytransfer import Discrete3DMeshRayTransferEmitter def index_func(x, y, z): if hypot(x, y) <= 1: return 0 elif 1 < hypot(x, y) <= 2: return 1 else: return -1 # must be set -1 outside meshes. world = World() bins = 2 # Note that bins must be same as the number of meshes. # Here thinking of two meshes like bins.shape = (2, ). material = Discrete3DMeshRayTransferEmitter(index_func, bins, integration_step=0.001) eps = 1.e-6 # ray must never leave the grid when passing through the volume radius = 2.0 - eps height = 10.0 cylinder = Cylinder( radius, height, material=material, parent=world, transform=translate(0, 0, -0.5 * height) ) camera.spectral_bins = material.bins # ray transfer matrix will be calculated for 600.5 nm camera.min_wavelength = 600. camera.max_wavelength = 601.
Methods
emission_function(point, direction, ...)The emission function for the material at a given sample point.
Virtual method for evaluating the spectrum at a material surface.
Virtual method for evaluating the spectrum emitted/absorbed along the rays trajectory through a material surface.
Notifies any connected scene-graph root of a change to the material.
Attributes
Number of raytransfer meshes which must not exceed the maximum of
index_function.Importance sampling weight for this material.