xopto.mcvox.mcsource.line module

class Line(position: Tuple[float, float, float] = (0.0, 0.0, 0.0), direction: Tuple[float, float, float] = (0.0, 0.0, 1.0))[source]

Bases: xopto.mcvox.mcsource.base.Source

Line photon packet source - equivalent of a spatial delta impulse.

Parameters
  • position ((float, float, float)) – Line source position as an array-like object of size 3 (x, y, z).

  • direction ((float, float, float)) – Line source direction vector as an array-like object of size 3 (px, py, pz).

Note

If the position lies outside of the sample, the entry point on the sample surface will be used to launch the packets. The entry point will be determined by propagating the position along the given direction. The MC simulation will start after subtracting the specular reflectance at the sample boundary from the initial weight of the packet. Note that in case the position lies within the sample, it will be used as the launch point and the packets will retain the full initial weight.

static cl_declaration(mc: xopto.mcbase.mcobject.McObject)str[source]

Structure that defines the source in the Monte Carlo simulator.

static cl_implementation(mc: xopto.mcbase.mcobject.McObject)str[source]

Implementation of the source in the Monte Carlo simulator.

cl_pack(mc: xopto.mcbase.mcobject.McObject, target: Optional[xopto.cl.cltypes.Structure] = None)Tuple[xopto.cl.cltypes.Structure, None, None][source]

Fills the ctypes structure (target) with the data required by the Monte Carlo simulator. See Line.cl_type() for a detailed list of fields.

Parameters
  • mc (mcobject.McObject) – Monte Carlo simulator instance.

  • target (mcypes.Structure) – Ctypes structure that is filled with the source data.

Returns

  • target (mctypes.Structures) – Filled ctypes structure received as an input argument or a new instance if the input argument target is None.

  • topgeometry (None) – This source does not use advanced geometry at the top sample surface.

  • bottomgeometry (None) – This source does not use advanced geometry at the bottom sample surface.

static cl_type(mc: xopto.mcbase.mcobject.McObject)xopto.cl.cltypes.Structure[source]
property direction: Tuple[float, float, float]

Source direction.

property position: Tuple[float, float, float]

Source position.

todict()dict[source]

Export object to a dict.

update(other: xopto.mcvox.mcsource.line.Line)[source]

Update this source configuration from the other source. The other source must be of the same type as this source or a dict with appropriate fields.

Parameters

other (Line or dict) – This source is updated with the configuration of the other source.