xopto.mcbase.mcpf.gk module

class Gk(g: float, a: float)[source]

Bases: xopto.mcbase.mcpf.pfbase.PfBase

Gegenbauer kernel scattering phase function constructor.

Parameters
  • g (float) – Parameter of the Gegenbauer kernel scattering scattering phase function. |g| <= 1

  • a (float) – Parameter of the Gegenbauer kernel scattering phase function. a > - 1/2 A value of 0.5 produces the Henyey-Greenstein scattering phase function.

property a: float

Parameter alpha.

static cl_declaration(mc: xopto.mcbase.mcobject.McObject)str[source]

OpenCL declarations of the scattering phase function.

static cl_implementation(mc: xopto.mcbase.mcobject.McObject)str[source]

OpenCL implementation of the scattering phase function.

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

Fills the an 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 ClGk if the input argument target is None.

Return type

cltypes.Structure

static cl_type(mc: xopto.mcbase.mcobject.McObject)xopto.cl.cltypes.Structure[source]

Returns an OpenCL structure that can be passed to the Monte carlo simulator.

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.

  • Structure fields

  • —————-

  • g (mc_fp_t) – Parameter of the Gegenbauer kernel scattering phase function.

  • a (mc_fp_t) – Parameter of the Gegenbauer kernel scattering phase function.

  • inv_a, a1, a2 (mc_fp_t) – Precalculated constants used to speed up the computation.

property g: float

Anisotropy factor when a=0.5.

pf()xopto.pf.gk.Gk[source]

Returns a new instance of the related utility scattering phase function class that can be used to compute Legendre moments and other scattering phase function quantifiers.

Returns

pf – Instance of the related utility scattering phase function.

Return type

xopto.pf.Gk

todict()dict[source]

Export object to a dict.