Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions jax_galsim/interpolant.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,12 +1498,16 @@ def _xval_noraise(self, x):
# it gets recompiled as needed for combinations of n, conserve_dc, du, and krange
@functools.partial(jax.jit, static_argnames=("n", "conserve_dc", "du", "krange"))
def _interp_kval(k, n, conserve_dc, du, krange):
_idata = _lanczos_kval_interp_table(
n,
du,
krange,
conserve_dc,
)
with jax.ensure_compile_time_eval():
_idata = _lanczos_kval_interp_table(
n,
# jax-galsim uses a slightly less accurate interpolation
# function (akima vs cubic spline) and so needs a smaller spacing
# 2.3x appears to be ok
du / 2.3,
krange,
conserve_dc,
)
return akima_interp(jnp.abs(k), *_idata, fixed_spacing=True)

def _kval_noraise(self, k):
Expand Down
2 changes: 1 addition & 1 deletion tests/GalSim
Loading