_pi_tau_nb

miepython.mie_jit._pi_tau_nb(mu, pi, tau)[source]

Compute the Mie scattering functions Ο€_n and Ο„_n for given cosine angles.

This function fills the pre-allocated arrays pi and tau with values of the Mie scattering functions for a given mu = cosπœƒ. The function uses the recurrence relations for the associated Legendre polynomials of the first kind P_n^1. The recurrence relations ensure numerical stability and avoids calling scipi.special.lpmv(1, n, cosπœƒ) for each n.

pi and tau are zero-based arrays and therefore

pi[n-1] = πœ‹_n(cosπœƒ) = P_n^1(cosπœƒ) / sinπœƒ

tau[n-1] = 𝜏_n(cosπœƒ) = d/dπœƒ P_n^1(cosπœƒ)`.

Parameters:
  • mu (float) – The cosine of the scattering angle, cos(πœƒ).

  • pi (numpy.ndarray) – A pre-allocated array to store pi_n values.

  • tau (numpy.ndarray) – A pre-allocated array to store tau_n values.

Returns:

nothing. pi and tau are modified