Discrete3DMeshRayTransferEmitter#

class cherab.lhd.emc3.raytransfer.Discrete3DMeshRayTransferEmitter#

Bases: InhomogeneousVolumeEmitter

A 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 in Discrete3DMeshRayTransferIntegrator, so this emitter must be placed inside a bounding box.

Parameters:
index_functioncallable()

Callable objects taking 3 positional arguments \((X, Y, Z)\).

binsint

Number of bins for the spectral array, by default 0.

integration_stepfloat, optional

The length of line integration step, by default 0.01.

integratorVolumeIntegrator, optional

Volume integrator, by default Discrete3DMeshRayTransferIntegrator(integration_step).

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.

evaluate_surface

Virtual method for evaluating the spectrum at a material surface.

evaluate_volume

Virtual method for evaluating the spectrum emitted/absorbed along the rays trajectory through a material surface.

notify_material_change

Notifies any connected scene-graph root of a change to the material.

Attributes

bins

Number of raytransfer meshes which must not exceed the maximum of index_function.

importance

Importance sampling weight for this material.

index_function

integrator

primitives