The interpolation coordinate is off by one in 'wrap' mode.
Test case:
a = array([0, 1, 0, -1.])
x = linspace(0, 8, 8, endpoint=False)
y = map_coordinate(a, [x], mode='wrap')
ynp = numpy.take(a, int64(x), mode='wrap')
Because x is strictly on a grid, one would expect y and ynp to be rather close.
The result is not:
y , ynp
(9.8982237337064127e-15, 0.0),
(0.99999999999999256, 1.0),
(2.2376848637928326e-15, 0.0),
(-0.99999999999999967, -1.0),
(0.99999999999999256, 0.0),
(2.2376848637928326e-15, 1.0),
(9.8982237337064127e-15, 0.0),
(0.99999999999999256, -1.0)
From y[4] it appears to be off by one.
The interpolation coordinate is off by one in 'wrap' mode.
Test case:
a = array([0, 1, 0, -1.])
x = linspace(0, 8, 8, endpoint=False)
y = map_coordinate(a, [x], mode='wrap')
ynp = numpy.take(a, int64(x), mode='wrap')
Because x is strictly on a grid, one would expect y and ynp to be rather close.
The result is not:
y , ynp
(9.8982237337064127e-15, 0.0),
(0.99999999999999256, 1.0),
(2.2376848637928326e-15, 0.0),
(-0.99999999999999967, -1.0),
(0.99999999999999256, 0.0),
(2.2376848637928326e-15, 1.0),
(9.8982237337064127e-15, 0.0),
(0.99999999999999256, -1.0)
From y[4] it appears to be off by one.