xopto.pf.doublehg module¶
- class DoubleHg(g1: float, g2: float, b: float)[source]¶
Bases:
xopto.pf.pfbase.PfBase
Double Henyey-Greenstein scattering phase function constructor.
- Parameters
g1 (float) – Anisotropy factor of the first Henyey-Greenstein scattering phase function.
g2 (float) – Anisotropy factor of the second Henyey-Greenstein scattering phase function.
b (float) – Fractional contribution of the first Henyey-Greenstein phase function.
Examples
Double 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]: >>> pf = DoubleHg(g, -g, 0.5) >>> pp.semilogy(cos_theta, pf(cos_theta), label='g1={}, g2={}, b=0.5'.format(g, -g)) >>> pp.legend()