Skip to content

Commit

Permalink
add some debug statements (to be removed eventually) and fix the NAXIS
Browse files Browse the repository at this point in the history
inserting
  • Loading branch information
keflavich committed Jun 4, 2017
1 parent 5acf7a8 commit f66aba8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions spectral_cube/lower_dimensional_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,18 @@ def header(self):
if 'NAXIS' in keyword:
del header[keyword]

header.insert(self.wcs.naxis, Card(keyword='NAXIS', value=self.ndim))
header.insert(3, Card(keyword='NAXIS', value=self.ndim))
for ind,sh in enumerate(self.shape[::-1]):
header.insert(3+ind, Card(keyword='NAXIS{0:1d}'.format(ind+1),
log.debug('Adding NAXIS{0} at position {1}'.format(ind+1,
3+ind+1))
header.insert(3+ind+1, Card(keyword='NAXIS{0:1d}'.format(ind+1),
value=sh))
if self.wcs.naxis > self.ndim:
assert ind != 0
for ii in range(self.wcs.naxis - self.ndim):
log.debug('Adding NAXIS{0}'.format(ind+ii+2))
header.insert(3+ind+ii+1,
log.debug('Adding NAXIS{0} at position {1}'.format(ind+ii+2,
3+ind+ii+2))
header.insert(3+ind+ii+2,
Card(keyword='NAXIS{0:1d}'.format(ind+ii+2),
value=1))

Expand Down

0 comments on commit f66aba8

Please sign in to comment.