xopto.pf.hg module

class Hg(g: float)[source]

Bases: xopto.pf.pfbase.PfBase

Henyey-Greenstein scattering phase function constructor.

Parameters

g (float) – Anisotropy factor.

Examples

Henyey-Greenstein scattering phase function for anisotropy factors g = {0, 0.3 0.5, 0.8, 0.9, 0.95}.

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

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

fastgs(last, **kwargs)[source]

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

g(n)[source]

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

gs(last)[source]

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