xopto.pf.mhg module¶
- class MHg(g: float, b: float)[source]¶
Bases:
xopto.pf.pfbase.PfBase
Modified Henyey-Greenstein scattering phase function.
- Parameters
g (float) – Anisotropy factor.
b (float) – Fractional contribution of the Henyey-Greenstein scattering phase function.
Examples
Modified Henyey-Greenstein scattering phase function fo anisotropy factors g = {0, 0.3 0.5, 0.8, 0.9, 0.95} 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 g in [0.0, 0.3, 0.5, 0.8, 0.9, 0.95]: >>> pp.semilogy(cos_heta, MHg(g, 0.5)(cos_theta), label='b=0.5, g={}'.format(g)) >>> 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 olution.