The optics_callables module

class tracer.optics_callables.AbsorberReflector(absorptivity)

This optics manager behaves similarly to the ReflectiveReceiver class, but adds directionality. In this way a simple one-side receiver doesn’t necessitate an extra surface in the back.

class tracer.optics_callables.AbsorptionAccountant(real_optics, absorptivity=1.0)

This optics manager remembers all of the locations where rays hit it in all iterations, and the energy absorbed from each ray.

Arguments

  • real_optics: the optics manager class to actually use. Expected to have the _abs protected attribute, and accept absorptivity as its only constructor argument (as in Reflective and LambertianReflector below).
  • absorptivity: to be passed to a new real_optics object.
get_all_hits()

Aggregate all hits from all stages of tracing into joined arrays.

Returns

  • absorbed: the energy absorbed by each hit-point
  • hits: the corresponding global coordinates for each hit-point.
reset()

Clear the memory of hits (best done before a new trace).

class tracer.optics_callables.LambertianReceiver(absorptivity=1.0)

A wrapper around AbsorptionAccountant with LambertianReflector optics

class tracer.optics_callables.LambertianReflector(absorptivity)

Represents the optics of an ideal diffuse (lambertian) surface, i.e. one that reflects rays in a random direction (uniform distribution of directions in 3D, see tracer.sources.pillbox_sunshape_directions)

class tracer.optics_callables.Reflective(absorptivity)

Generates a function that represents the optics of an opaque, absorptive surface with specular reflections.

Arguments

  • absorptivity: the amount of energy absorbed before reflection.

Returns

  • refractive: a function with the signature required by Surface.
class tracer.optics_callables.ReflectiveReceiver(absorptivity=1.0)

A wrapper around AbsorptionAccountant with a Reflective optics

class tracer.optics_callables.RefractiveHomogenous(n1, n2)

Represents the optics of a surface bordering homogenous media with constant refractive index on each side. The specific index in which a refracted ray moves is determined by toggling between the two possible indices.

Arguments

n1, n2 - scalars representing the homogenous refractive index on each side of the surface (order doesn’t matter).

toggle_ref_idx(current)

Determines which refractive index to use based on the refractive index rays are currently travelling through.

Arguments

  • current: an array of the refractive indices of the materials each of the rays in a ray bundle is travelling through.

Returns

An array of length(n) with the index to use for each ray.

Previous topic

The surface module

Next topic

Surface geometry managers

This Page