init_igamma_splines
- zdm.energetics.init_igamma_splines(gammas, reinit=False, k=3)[source]
Initialize spline interpolators for the upper incomplete gamma function.
Pre-computes spline representations of the upper incomplete gamma function Gamma(gamma, x) for fast evaluation during grid calculations. Splines are cached globally and reused across calls.
- Parameters:
gammas (list of float) – Values of gamma (the shape parameter) for which to create splines.
reinit (bool, optional) – If True, reinitialize splines even if they already exist. Default False.
k (int, optional) – Degree of spline interpolation. Default is 3 (cubic). Valid range: 1-5. Note: k=2 and k=4 not recommended due to numerical issues.
Notes
If module variable SplineLog is True (default), interpolation is performed in log-log space, which provides better accuracy over the wide dynamic range of the incomplete gamma function.