xopto.pf.mpc module

class MPc(n: float, b: float)[source]

Bases: xopto.pf.pfbase.PfBase

Modified power of cosines scattering phase function constructor.

Pc(\cos(\theta)) &= \frac{(n + 1)}{2}^{(n + 1)} * (1 + \cos(\theta))^n

MPc(\cos(\theta)) &= b Pc (\cos(\theta)) + \frac{3}{2}(1 - b)\cos(\theta)^2

Parameters
  • n (float) – Parameter of the power of cosine scattering phase function.

  • b (float) – Contribution of the Power of cosine scattering component. Contribution of the Rayleigh scattering component is (1 - b).

Examples

Modified Power of cosines scattering phase function. n = {0.1, 0.5, 1.0, 2.0, 5.0, 10.0} and b=0.5

>>> import numpy as np
>>> from matplotlib import pyplot as pp
>>>
>>> cos_theta = np.linspace(-1.0, 1.0, 1000)
>>>
>>> pp.figure()
>>> for n in [0.1, 0.5, 1.0, 2.0, 5.0, 10.0]:
>>>     pp.semilogy(cos_theta, MPc(n, 0.5)(cos_theta), label='n={}, b=0.5'.format(n))
>>> pp.legend()
fastg(n: int, **kwargs)float[source]

Overloads the PfBase.fastg() method of the base class with an analytical solution.

fastgs(last: int, **kwargs)numpy.ndarray[source]

Overloads the PfBase.fastgs() method of the base class with an analytical solution.

g(n: int)float[source]

Overloads the PfBase.g() method of the base class with an analytical solution.

gs(last: int)numpy.ndarray[source]

Overloads the PfBase.gs() method of the base class with an analytical solution.