xopto.mccyl.mcsource.line module¶
- class Line(position: Tuple[float, float, float] = (0.0, 0.0, 0.0), direction: Tuple[float, float, float] = (1.0, 0.0, 0.0))[source]¶
Bases:
xopto.mccyl.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
The line will be first propagated from the given position to the entry point on the sample surface along the propagation direction (no interactions with the medium during this step). Note that in case the position lies within the sample, the line will be propagated to the entry point using reversed direction. From there it will be refracted into the sample. The MC simulation will start after subtracting the specular reflectance at the sample boundary from the initial weight of the packet.
- 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.
- update(other: xopto.mccyl.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.