Skip to content

Commit

Permalink
Tidy up grid creation
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Apr 5, 2024
1 parent a8acad8 commit 2d12ab7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions xarrayfits/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ def __init__(self, header: Mapping):

self._grid = []

for d in range(ndims):
pixels = np.arange(1, self._naxis[d] + 1, dtype=np.float64)
self._grid.append(
(pixels - self._crpix[d]) * self._cdelt[d] + self._crval[d]
)
for na, rp, dt, rv in zip(self._naxis, self._crpix, self._cdelt, self._crval):
pixels = np.arange(1, na + 1, dtype=np.float64)
self._grid.append((pixels - rp) * dt + rv)

@property
def naxis(self):
Expand Down

0 comments on commit 2d12ab7

Please sign in to comment.