Hi, working for the variation of the Quintic kernel #1265 along the line of Gary & Daniel 2014 paper, I mention that the code below in Interpolant.cpp
double Interpolant::xvalWrapped(double x, int N) const
{
// sum over all arguments x+jN that are within range.
// Start by finding x+jN closest to zero
double xdown = x - N*std::floor(x/N + 0.5);
xassert(std::abs(xdown) <= N);
if (xrange() <= N) {
// This is the usual case.
return xval(xdown);
} else {
double xup = xdown+N;
double sum = 0.;
while (std::abs(xdown) <= xrange()) {
sum += xval(xdown);
xdown -= N;
}
while (xup <= xrange()) {
sum += xval(xup);
xup += N;
}
return sum;
}
}
implements the following equation of the 2014 paper
But, discussing with Gary, I've mebtioned that in fact the true kernel (aka periodic cardinal sinus)
can be directly approximated by any "sinc" approximated kernel (noted ker) with the following generic python code
(of course this is not an optimized code)
One can reproduce the figure of the paper using such convolution.
Gary says that : "it would be interesting to see numerically how accurate this is. I suppose it’s a speedup of a few since you don’t have to sum over the aliased frequencies any more."
Hi, working for the variation of the Quintic kernel #1265 along the line of Gary & Daniel 2014 paper, I mention that the code below in
Interpolant.cpp
implements the following equation of the 2014 paper![image](https://github.com/GalSim-developers/GalSim/assets/20539759/558d365d-37c3-4193-b5c8-1c2b506875b6)
But, discussing with Gary, I've mebtioned that in fact the true kernel (aka periodic cardinal sinus)
can be directly approximated by any "sinc" approximated kernel (noted
ker
) with the following generic python code (of course this is not an optimized code)and then one perform a single convolution (Eq. of 11 in the paper) with the wrapped kernel above
One can reproduce the figure of the paper using such convolution.
Gary says that : "it would be interesting to see numerically how accurate this is. I suppose it’s a speedup of a few since you don’t have to sum over the aliased frequencies any more."