xopto.mcbase.mcpf.mhg module

class MHg(g: float, b: float)[source]

Bases: xopto.mcbase.mcpf.pfbase.PfBase

Modified Henyey-Greenstein scattering phase function constructor.

b*HG(g) + frac{2}{3} (1 - b) cos^{2}(theta)

Parameters
  • g (float) – Anisotropy factor. Assigned to the first user-defined scattering phase function parameter.

  • b (float) – Contribution of the Henyey-Greenstein scattering phase function.

property b: float

Contribution of the Henyey-Greenstein scattering phase function.

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 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 ClMHg 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 Henyey-Greenstein scattering phase function.

  • beta (mc_fp_t) – Contribution of the Henyey-Greenstein scattering phase function.

property g: float

Anisotropy factor.

pf()xopto.pf.mhg.MHg[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.MHg

todict()dict[source]

Export object to a dict.