xopto.mcml.mcsource.fiberni module¶
- class LambertianFiberNI(fiber: xopto.mcbase.mcutil.fiber.MultimodeFiber, position: Tuple[float, float, float] = (0.0, 0.0, 0.0))[source]¶
Bases:
xopto.mcml.mcsource.fiberni.UniformFiberNI
An optical fiber photon packet source.
- Parameters
mc (McObject) – A Monte Carlo simulator instance.
- Returns
struct (cltypes.Structure) – A structure type that represents the scattering phase function in the Monte Carlo kernel.
———-
fiber (MultimodeFiber) – Optical fiber parameters.
position ((float, float, float)) – Center position the fiber source array-like object of size 3 (x, y, z). The z coordinate is ignored and set to 0.
- 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 structure (target) with the data required by the Monte Carlo simulator. See the
LambertianFiberNI.cl_type()
for a detailed list of fields.- Parameters
mc (mcobject.McObject) – Monte Carlo simulator instance.
target (cltypes.Structure) – Structure that is filled with the source data.
- Returns
target (cltypes.Structure) – 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]¶
- class TopGeometryFiberNI(fiber: xopto.mcml.mcsource.fiberni.UniformFiberNI)[source]¶
Bases:
xopto.mcbase.mcobject.McObject
- static cl_declaration(mc: xopto.mcbase.mcobject.McObject) → str[source]¶
- static cl_implementation(mc: xopto.mcbase.mcobject.McObject) → str[source]¶
- cl_pack(mc: xopto.mcbase.mcobject.McObject, target: Optional[xopto.cl.cltypes.Structure] = None) → xopto.cl.cltypes.Structure[source]¶
Fills the structure (target) with the data required by the Monte Carlo simulator. See the
FiberGeometryTopNI.cl_type()
for a detailed list of fields.- Parameters
mc (mcobject.McObject) – Monte Carlo simulator instance.
target (cltypes.Structure) – Structure that is filled with the source data.
- Returns
target – Filled ctypes structure received as an input argument or a new instance if the input argument target is None.
- Return type
- static cl_type(mc: xopto.mcbase.mcobject.McObject) → xopto.cl.cltypes.Structure[source]¶
Top sample surface geometry representing an optical fiber with normal incidence.
- Parameters
mc (McObject) – A Monte Carlo simulator instance.
- Returns
struct (cltypes.Structure) – A structure type that represents the top geometry in the Monte Carlo kernel.
Fields
——
position (mc_point3f_t) – Position of the optical fiber in the Monte Carlo coordinate system.
core_radius (mc_fp_t) – Outer radius of the fiber core.
cladding_radius (mc_fp_t) – Outer radius of the fiber cladding.
core_n (mc_fp_t) – Refractive index of the fiber core.
cladding_n (mc_fp_t) – Refractive index of the fiber cladding.
core_cos_critical (mc_fp_t) – Cosine of the total internal reflection angle for the transition sample -> fiber core.
cladding_cos_critical (mc_fp_t) – Cosine of the total internal reflection angle for the transition sample -> fiber cladding.
- class UniformFiberLutNI(fiber: xopto.mcbase.mcutil.fiber.MultimodeFiberLut, position: Tuple[float, float, float] = (0.0, 0.0, 0.0))[source]¶
Bases:
xopto.mcml.mcsource.base.Source
An optical fiber photon packet source with emission characteristics defined by a lookup table. The lookup table is sampled using a uniform random variable and linear interpolation. The obtained value represents cosine of the propagation direction with respect to the fiber normal. The propagation direction cosines defined in the lookup table should be valid for a surrounding medium with a refractive index 1 (air). The propagation direction is internally adjusted according to the refractive index of the medium surrounding the optical fiber: sin(theta_lut) = n_medium*sin(theta_medium). The reflectance at the optical fiber-medium boundary is subtracted from the initial weight of the photon packet.
- Parameters
lut (np.ndarray) – Lookup table data (cos(theta_air)).
diameter (float) – Diameter of the fiber core.
n (float) – Refractive index of the fiber core.
position ((float, float, float)) – Center of the fiber source give as a tuple (x, y, z). The z coordinate is ignored and set to 0.
- 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.
- static cl_options(mc: xopto.mcbase.mcobject.McObject) → List[Tuple[str, str]][source]¶
This source uses lookup table of floating-point data.
- cl_pack(mc: xopto.mcbase.mcobject.McObject, target: Optional[xopto.cl.cltypes.Structure] = None) → xopto.cl.cltypes.Structure[source]¶
Fills the ctypes structure (target) with the data required by the Monte Carlo simulator. See the UniformFiberLutNI.cl_type class for a detailed list of fields.
- Parameters
mc (mcobject.McObject) – Monte Carlo simulator instance.
target (cltypes.Structure) – Ctypes structure that is filled with the source data.
- Returns
target (cltypes.Structure) – 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 fiber: xopto.mcbase.mcutil.fiber.MultimodeFiberLut¶
Multimode lookup table optical fiber.
- classmethod fromdict(data: dict) → xopto.mcml.mcsource.fiberni.UniformFiberNI[source]¶
Create a new instance of a photon packet source from a dict that was created by the
todict()
method.
- property position: Tuple[float, float, float]¶
Source position.
- update(other: xopto.mcml.mcsource.fiberni.UniformFiberLutNI)[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 (UniformFiberLutNI or dict) – This source is updated with the configuration of the other source.
- class UniformFiberNI(fiber: xopto.mcbase.mcutil.fiber.MultimodeFiber, position: Tuple[float, float, float] = (0.0, 0.0, 0.0))[source]¶
Bases:
xopto.mcml.mcsource.base.Source
An optical fiber photon packet source.
- Parameters
mc (McObject) – A Monte Carlo simulator instance.
- Returns
struct (cltypes.Structure) – A structure type that represents the scattering phase function in the Monte Carlo kernel.
———-
fiber (MultimodeFiber) – Optical fiber parameters.
position ((float, float, float)) – Center position the fiber source array-like object of size 3 (x, y, z). The z coordinate is ignored and set to 0.
- 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 structure (target) with the data required by the Monte Carlo simulator. See the
UniformFiberNI.cl_type()
for a detailed list of fields.- Parameters
mc (mcobject.McObject) – Monte Carlo simulator instance.
target (cltypes.Structure) – Structure that is filled with the source data.
- Returns
target (cltypes.Structure) – 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 fiber: xopto.mcbase.mcutil.fiber.MultimodeFiber¶
Multimode optical fiber.
- classmethod fromdict(data: dict) → xopto.mcml.mcsource.fiberni.UniformFiberNI[source]¶
Create a new instance of a photon packet source from a dict that was created by the
todict()
method.
- property position: Tuple[float, float, float]¶
Source position.
- update(other: xopto.mcml.mcsource.fiberni.UniformFiberNI)[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.mcml.mcsource.UniformFiber or dict) – This source is updated with the configuration of the other source.