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 aa061ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions xarrayfits/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ 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 enumerate(
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 aa061ed

Please sign in to comment.