xopto.mcvox.mcsource.point module

class IsotropicPoint(position: Tuple[float, float, float] = (0.0, 0.0, 0.0))[source]

Bases: xopto.mcvox.mcsource.base.Source

Isotropic point source of photon packets.

Parameters

position ((float, float, float)) – Source position as an array-like object of size 3 (x, y, z). The position must be located above or within the sample but not under the sample.

Note

If the source position lies outside of the sample, the entry point into the sample is determined by propagating the packet from the source position along the launch direction. The MC simulation will start after refracting the packet into the sample and subtracting the specular reflectance at the sample boundary from the initial weight of the packet. If the photon packet does not intersect the sample, the initial weight will be set to 0 (reflectance to 1) and the packet will be launched from the top-left corner of the voxelized sample box. Such zero-weight packets are immediately terminated and have no contribution to the fluence and surface detectors, however will be included in the trace (have no effect on the sampling volume or other trace-based analysis due to zero-weight). 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 IsotropicPoint.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 position: Tuple[float, float, float]

Source position.

todict()dict[source]

Export object to a dict.

update(other: xopto.mcvox.mcsource.point.IsotropicPoint)[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 (xopto.mcvox.mcsource.point.IsotropicPoint or dict) – This source is updated with the configuration of the other source.