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

HAZE_GARCIA_SIEWERT = 4

Haze L (Garcia and Siewert [1985] table 10)

CLOUD_GARCIA_SIEWERT = 5

Cloud C.1 (Garcia and Siewert [1985] table 17)

__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.

nanodisort.utils.phase_functions.haze_l(nmom: int) ndarray[tuple[Any, ...], dtype[float64]][source]

Generate Haze-L phase function moments.

nanodisort.utils.phase_functions.cloud_c1(nmom: int) ndarray[tuple[Any, ...], dtype[float64]][source]

Generate Cloud C.1 phase function moments.