xopto.mcbase.mcpf.pc module¶
- class Pc(n: float)[source]¶
Bases:
xopto.mcbase.mcpf.pfbase.PfBase
Power of cosines (PC) scattering phase function.
- Parameters
n (float >= 0) – Parameter of the power of cosine scattering phase function.
Note
The cumulative density function of PC follows:
For a given uniformly distributed random number :math`xi in [0, 1]`, the scattering angle cosine can be computed as:
Since this expression becomes singular for n=-1, only positive values of
are allowed.
- 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 OpenCL Structure (target) with the data required by the Monte Carlo simulator. See the
cl_type()
method for a detailed list of fields.- Parameters
mc (McObject) – Simulator instance.
target (cltypes.Structure) – Target OpenCL structure for packing.
- Returns
target – Target structure received as an input argument or a new instance of ClPc if the input argument target is None.
- Return type
- cl_type() → 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
—————-
n (mc_fp_t) – Power of the cosine,
- property n: float¶
Power of cosine.
- pf() → xopto.pf.pc.Pc[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.Pc