nanodisort.utils.phase_functions¶
This module provides functions to generate Legendre expansion coefficients
for various phase functions, matching cdisort’s c_getmom() function.
- class nanodisort.utils.phase_functions.PhaseFunction[source]¶
Phase function type constants (matching cdisort.h).
- ISOTROPIC = 1¶
Isotropic scattering
- RAYLEIGH = 2¶
Rayleigh scattering
- HENYEY_GREENSTEIN = 3¶
Henyey-Greenstein
- __new__(value)¶
- nanodisort.utils.phase_functions.getmom(iphas: PhaseFunction, gg: float, nmom: int) ndarray[tuple[Any, ...], dtype[float64]][source]¶
Calculate phase function Legendre expansion coefficients.
This function mimics the
c_getmom()function from cdisort.c.- Parameters:
iphas (
PhaseFunction) – Phase function type.gg (
float) – Asymmetry factor for Henyey-Greenstein case (must be in (-1, 1)).nmom (
int) – Index of highest Legendre coefficient needed.
- Returns:
pmom – Legendre expansion coefficients (shape: (nmom+1,))
- Return type:
ndarray
- nanodisort.utils.phase_functions.isotropic(nmom: int) ndarray[tuple[Any, ...], dtype[float64]][source]¶
Generate isotropic phase function moments.
- nanodisort.utils.phase_functions.rayleigh(nmom: int) ndarray[tuple[Any, ...], dtype[float64]][source]¶
Generate Rayleigh phase function moments.
- nanodisort.utils.phase_functions.henyey_greenstein(gg: float, nmom: int) ndarray[tuple[Any, ...], dtype[float64]][source]¶
Generate Henyey-Greenstein phase function moments.