Skip to content

Commit

Permalink
fix some indexing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Alan Weaver committed Dec 2, 2015
1 parent 14a871f commit 216b2ac
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pydl/pydlspec2d/spec1d/readspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def readspec(platein, mjd=None, fiber='all', **kwargs):
(mjdvec == thismjd)).nonzero()[0]
thisfiber = fibervec[pmjdindex]
# log.debug(type(thisplate), type(thismjd))
log.info(repr(thisfiber))
log.info(type(thisfiber))
pmjdstr = "{0:04d}-{1:05d}".format(int(thisplate), int(thismjd))
if 'path' in kwargs:
sppath = [kwargs['path']]
Expand All @@ -133,10 +135,13 @@ def readspec(platein, mjd=None, fiber='all', **kwargs):
# Read the data images
#
for k in range(len(hdunames)):
try:
tmp = spplate[k].data[thisfiber-1, :]
except IndexError:
tmp = spplate[k].data[thisfiber-1]
if hdunames[k] == 'loglam':
tmp = loglam
else:
try:
tmp = spplate[k].data[thisfiber-1, :]
except IndexError:
tmp = spplate[k].data[thisfiber-1]
if hdunames[k] not in spplate_data:
if k == 0:
allpmjdindex = pmjdindex
Expand Down

0 comments on commit 216b2ac

Please sign in to comment.