xopto.mcbase.mcpf.gk2 module

class Gk2(g1: float, a1: float, g2: float, a2: float, b: float)[source]

Bases: xopto.mcbase.mcpf.pfbase.PfBase

Gegenbauer kernel scattering phase function constructor.

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

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

  • g2 (float) – Parameter of the second Gegenbauer kernel scattering scattering phase function. -1 <= g < 0

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

  • b (float) – A value between 0 and 1 that determines the relative contribution of the second Gegenbauer kernel scattering scattering phase function.

property a1: float

Parameter alpha of the first GK term.

property a2: float

Parameter alpha of the second GK term.

property b: float

Relative contribution of the second GK term.

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

  • —————-

  • gk_1 (mc_pf_gk_t) – Parameters of the first Gegenbauer kernel scattering phase function.

  • gk_2 (mc_pf_gk_t) – Parameters of the second Gegenbauer kernel scattering phase function.

  • b (mc_fp_t) – Relative contribution of the second Gegenbauer kernel scattering phase function.

property g1: float

Parameter g (anisotropy factor when a=0.5) of the first GK term.

property g2: float

Parameter g (anisotropy factor when a=0.5) of the second GK term.

pf()xopto.pf.gk2.Gk2[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.Gk2

todict()dict[source]

Export object to a dict.