File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change
1
+
1
2
import numpy as np
2
3
3
4
from astropy .wcs .wcsapi .wrappers .base import BaseWCSWrapper
@@ -42,13 +43,13 @@ def _top_to_underlying_pixels(self, top_pixels):
42
43
# Convert user-facing pixel indices to the pixel grid of underlying WCS.
43
44
factor = self ._pad_dims (self ._factor , top_pixels .ndim )
44
45
offset = self ._pad_dims (self ._offset , top_pixels .ndim )
45
- return (top_pixels + factor / 2 ) * factor + offset
46
+ return (top_pixels * factor ) + 1 + offset
46
47
47
48
def _underlying_to_top_pixels (self , underlying_pixels ):
48
49
# Convert pixel indices of underlying pixel grid to user-facing grid.
49
50
factor = self ._pad_dims (self ._factor , underlying_pixels .ndim )
50
51
offset = self ._pad_dims (self ._offset , underlying_pixels .ndim )
51
- return (underlying_pixels - offset ) / factor
52
+ return (underlying_pixels - 1 - offset ) / factor
52
53
53
54
def _pad_dims (self , arr , ndim ):
54
55
# Pad array with trailing degenerate dimensions.
You can’t perform that action at this time.
0 commit comments