xopto.mcbase.mcpf.hg module

class Hg(g: float)[source]

Bases: xopto.mcbase.mcpf.pfbase.PfBase

Henyey-Greenstein scattering phase function object constructor.

Parameters

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

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 ClHg 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,

property g: float

Anisotropy factor.

pf()xopto.pf.hg.Hg[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.Hg

todict()dict[source]

Export object to a dict.