xopto.pf.pc module

class Pc(n: float)[source]

Bases: xopto.pf.pfbase.PfBase

Power of cosines scattering phase function constructor.

p(cos(theta)) = frac{(n + 1)}/{2^{(n + 1)}} (1 + cos(theta))^n

Parameters

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

Examples

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

>>> 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, Pc(n)(cos_theta), label='n={}'.format(n))
>>> pp.legend()
fastg(n: int, **kwargs)float[source]

Overloads the py:meth:PfBase.fastg method of the base class with an analytical solution.

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

Overloads the py:meth: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 py:meth:PfBase.gs method of the base class with an analytical solution.