xopto.pf.gk module

class Gk(gg: float, a: float)[source]

Bases: xopto.pf.pfbase.PfBase

Gegenbauer Kernel scattering phase function constructor.

Parameters
  • gg (float) – Parameter of the Gegenbauer kernel phase function (|gg| <= 1).

  • a (float) – Parameter of the Gegenbauer kernel phase function (a > - 1/2). A value of 0.5 produces the Henyey-Greenstein scattering phase function.

Examples

Gegenbauer kernel scattering phase function for gg = {0, 0.3 0.5, 0.8, 0.9, 0.95} and a=0.5.

>>> import numpy as np
>>> from matplotlib import pyplot as pp
>>>
>>> cos_theta = np.linspace(-1.0, 1.0, 1000)
>>>
>>> pp.figure()
>>> for gg in [0.0, 0.3, 0.5, 0.8, 0.9, 0.95]:
>>>     pp.semilogy(cos_theta, Gk(gg, 0.5)(cos_theta), label='a=0.5, gg={}'.format(gg))
>>> pp.legend()
fastg(n: int, *args, **kwargs)float[source]

Overloads the PfBase.fastg() method of the base class.

Note

Using analytical solution for n = 0, 1, 2 or 3.

g(n, *args, **kwargs)[source]

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