xopto.mcml.mcsource.rectangular module

class LambertianRectangular(width: float, height: float, n: float, na: float, position: Tuple[float, float, float] = (0.0, 0.0, 0.0))[source]

Bases: xopto.mcml.mcsource.rectangular.UniformRectangular

A rectangular optical photon packet source with a Lambertian emission characteristics defined by the numerical aperture. The propagation direction is internally adjusted according to the refractive index of the medium surrounding the source: sin(theta_lut) = n_medium*sin(theta_medium). The reflectance at the source-medium boundary is subtracted from the initial weight of the photon packet.

Parameters
  • width (float) – Source width (x) in (m).

  • height (float) – Source height (y) in (m).

  • n (float) – Refractive index of the source.

  • na (float) – Numerical aperture of the source in air (emission is cut off at the NA).

  • position ((float, float, float)) – Center of the source beam/rectangle as an array-like object of size 3 (px, py, pz).

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 kernel. See the RectangularLut.cl_type() method for a detailed list of fields.

Parameters
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 UniformRectangular(width: float, height: float, n: float, na: float, position: Tuple[float, float, float] = (0.0, 0.0, 0.0))[source]

Bases: xopto.mcml.mcsource.base.Source

A rectangular optical photon packet source with emission characteristics defined by the numerical aperture The propagation direction is internally adjusted according to the refractive index of the medium surrounding the source: sin(theta_lut) = n_medium*sin(theta_medium). The reflectance at the source-medium boundary is subtracted from the initial weight of the photon packet.

Parameters
  • width (float) – Source width (x) in (m).

  • height (float) – Source height (y) in (m).

  • n (float) – Refractive index of the source.

  • na (float) – Numerical aperture of the source in air (emission is cut off at the NA).

  • position ((float, float, float)) – Center of the source beam/rectangle as an array-like object of size 3 (px, py, pz).

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 kernel. See the RectangularLut.cl_type() method for a detailed list of fields.

Parameters
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 height: float

Source height (m).

property n: float

Source refractive index.

property na: float

Source numerical aperture (NA).

property position: Tuple[float, float, float]

Source position.

todict()dict[source]

Export object to a dict.

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

property width: float

Source width (m).

class UniformRectangularLut(lut: xopto.mcbase.mcutil.lut.CollectionLut, width: float, height: float, n: float, position: Tuple[float, float, float] = (0.0, 0.0, 0.0))[source]

Bases: xopto.mcml.mcsource.base.Source

A rectangular optical 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 source 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 source: sin(theta_lut) = n_medium*sin(theta_medium). The reflectance at the source-medium boundary is subtracted from the initial weight of the photon packet.

Parameters
  • lut (CollectionLut) – Lookup table of the angular sensitivity.

  • width (float) – Source width (x) in (m).

  • height (float) – Source height (y) in (m).

  • n (float) – Refractive index of the source.

  • position ((float, float, float)) – Center of the source beam/rectangle as an array-like object of size 3 (px, py, pz).

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]
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 kernel. See the UniformRectangularLut.cl_type() method for a detailed list of fields.

Parameters
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]
static fromdict(data)xopto.mcml.mcsource.rectangular.UniformRectangularLut[source]

Create a source instance from a dictionary.

Parameters

data (dict) – Dictionary created by the Radial.todict() method.

property height: float

Source height (m).

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

Lookup table of angular sensitivity.

property n: float

Source refractive index.

property position: Tuple[float, float, float]

Source position.

todict()dict[source]

Save the source configuration data to a dictionary. Use the UniformRectangularLut.fromdict() method to create a new source instance from the returned data.

Returns

data – Source configuration as a dictionary.

Return type

dict

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

property width: float

Source width (m).