xopto.mcbase.mcutil.fiber module

class FiberLayout(fiber: xopto.mcbase.mcutil.fiber.MultimodeFiber, position: Tuple[float, float, float] = (0.0, 0.0, 0.0), direction: Tuple[float, float, float] = (0.0, 0.0, 1.0))[source]

Bases: object

Optical fiber layout constructor.

Parameters
  • fiber (MultimodeFiber or MultimodeFiberLut or FiberLayout) – A multimode optical fiber instance or a fiber layout instance. If a fiber layout instance, a new copy is created.

  • position (tuple(float, float, float)) – Position of the fiber tip center.

  • direction – Direction/orientation of the fiber.

  • --------

property direction: Tuple[float, float, float]

Fiber reference direction.

property fiber: xopto.mcbase.mcutil.fiber.MultimodeFiber

Properties of the optical fiber.

static fromdict(data: dict)xopto.mcbase.mcutil.fiber.MultimodeFiber[source]

Create an accumulator instance from a dictionary.

Parameters

data (dict) – Dictionary created by the py:meth:FiberLayout.todict method.

property position: Tuple[float, float, float]

Position of the fiber as a tuple (x, y, z).

todict()dict[source]

Export object to a dict.

class MultimodeFiber(dcore: float, dcladding: float, ncore: float, na: float)[source]

Bases: object

Class representing Multimode step-index fibers with an ideal emission and collection characteristics defined by the numerical aperture.

Multimode fiber constructor.

Parameters
  • dcore (float) – Diameter (m) of the fiber core.

  • dcladding (float) – Diameter (m) of the fiber cladding.

  • ncore (float) – Refractive index of the fiber core.

  • na (float) – Numerical aperture of the fiber core.

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

Fills the OpenCL Structure (target) with the data required by the Monte Carlo simulator. See the cl_type() method for a detailed list of fields.

Parameters
Returns

target – Target structure received as an input argument or a new instance of ClMultimodeFiber if the input argument target is None.

Return type

cltypes.Structure

static cl_type(mc: xopto.mcbase.mcobject.McObject)xopto.cl.cltypes.Structure[source]
static compute_na(ncore: float, ncladding: float)float[source]

Computes the numerical aperture of the fiber core given the refractive indices of the fiber core and fiber cladding.

Parameters
  • ncore (float) – Refractive index of the fiber core.

  • ncladding (float) – Refractive index of the fiber cladding.

Returns

na – Numerical aperture of the fiber core.

Return type

float

static compute_ncladding(ncore: float, na: float)float[source]

Computes the refractive index of the fiber cladding given the refractive index and numerical aperture of the fiber core.

Parameters
  • ncore (float) – Refractive index of the fiber core.

  • na (float) – Numerical aperture of the fiber core.

Returns

ncladding – Refractive index of the fiber cladding.

Return type

float

property dcladding: float

Diameter (m) of the fiber cladding.

property dcore: float

Diameter (m) of the fiber core.

static fromdict(data: dict)xopto.mcbase.mcutil.fiber.MultimodeFiber[source]

Create an accumulator instance from a dictionary.

Parameters

data (dict) – Dictionary created by the py:meth:MultimodeFiber.todict method.

property na: float

Numerical aperture (NA) of the fiber core.

property ncladding: float

Refractive index of the fiber cladding computed as $sqrt(ncore^2 - na^2)$

property ncore: float

Refractive index of the fiber core.

todict()dict[source]

Export object to a dict.

validate()[source]

Check the integrity of the object parameters. Raises ValueError.

class MultimodeFiberLut(dcore: float, dcladding: float, ncore: float, ncladding: float, emission: Optional[xopto.mcbase.mcutil.lut.EmissionLut] = None, collection: Optional[xopto.mcbase.mcutil.lut.CollectionLut] = None)[source]

Bases: object

Class representing multimode fibers with arbitrary emission and collection characteristics defined by a linear lookup table.

Multimode fiber constructor.

Parameters
  • dcore (float) – Diameter (m) of the fiber core.

  • dcladding (float) – Diameter (m) of the fiber cladding.

  • ncore (float) – Refractive index of the fiber core.

  • ncladding (float) – Refractive index of the fiber cladding.

  • emission (EmissionLut or np.ndarray or str) – Lookup table for numerical sampling of the emission angles. Can be an instance of EmissionLut or a file from which to load the EmissionLut.

  • collection (CollectionLut or str) – Collection sensitivity/efficiency of the fiber defined by a linear lookup table array. Can be an instance of CollectionLut or a file from which to load the CollectionLut.

property collection: xopto.mcbase.mcutil.lut.CollectionLut

Collection lookup table.

static compute_na(ncore: float, ncladding: float)float[source]

Computes the numerical aperture of the fiber core given the refractive indices of the fiber core and fiber cladding.

Parameters
  • ncore (float) – Refractive index of the fiber core.

  • ncladding (float) – Refractive index of the fiber cladding.

Returns

na – Numerical aperture of the fiber core.

Return type

float

static compute_ncladding(ncore: float, na: float)float[source]

Computes the refractive index of the fiber cladding given the refractive index and numerical aperture of the fiber core.

Parameters
  • ncore (float) – Refractive index of the fiber core.

  • na (float) – Numerical aperture of the fiber core.

Returns

ncladding – Refractive index of the fiber cladding.

Return type

float

property dcladding: float

Diameter (m) of the fiber cladding.

property dcore: float

Diameter (m) of the fiber core.

property emission: xopto.mcbase.mcutil.lut.EmissionLut

Emission lookup table.

property ncladding: float

Refractive index of the fiber cladding computed as $sqrt(ncore^2 - na^2)$

property ncore: float

Refractive index of the fiber core.

todict()dict[source]

Export object to a dict.

validate()[source]

Check the integrity of parameters. Raises a ValueError.