Skip to content

Commit

Permalink
fix fibermap dtype for astropy 1.3 (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbailey authored Apr 26, 2017
1 parent f600123 commit d7b5ad5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion doc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ desispec Change Log

* Set default brick size to 0.25 sq. deg. in desispec.brick (PR `#378`_).
* Added function to calculate BRICKID at a given location (PR `#378`_).
* Additional LOCATION, DEVICE_LOC, and PETAL_LOC columns for fibermap.
* Additional LOCATION, DEVICE_LOC, and PETAL_LOC columns for fibermap (PR `#379`_).

.. _`#378`: https://github.com/desihub/desispec/pull/378
.. _`#379`: https://github.com/desihub/desispec/pull/379

0.14.0 (2017-04-13)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion py/desispec/io/brick.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, path, mode='readonly', header=None):
self.channel = 'brz' #- could be any spectrograph channel

# Create the parent directory, if necessary.
head,tail = os.path.split(self.path)
head,tail = os.path.split(os.path.abspath(self.path))
if not os.path.exists(head):
os.makedirs(head)
# Create empty HDUs. It would be good to refactor io.frame to avoid any duplication here.
Expand Down
20 changes: 11 additions & 9 deletions py/desispec/io/fibermap.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,17 @@ def empty_fibermap(nspec, specmin=0):

fiberpos = desimodel.io.load_fiberpos()
ii = slice(specmin, specmin+nspec)
fibermap['X_TARGET'] = fiberpos['X'][ii]
fibermap['Y_TARGET'] = fiberpos['Y'][ii]
fibermap['X_FVCOBS'] = fiberpos['X'][ii]
fibermap['Y_FVCOBS'] = fiberpos['Y'][ii]
fibermap['POSITIONER'] = fiberpos['LOCATION'][ii] #- deprecated
fibermap['LOCATION'] = fiberpos['LOCATION'][ii]
fibermap['PETAL_LOC'] = fiberpos['PETAL'][ii]
fibermap['DEVICE_LOC'] = fiberpos['DEVICE'][ii]
fibermap['LAMBDA_REF'] = 5400.0
fibermap['X_TARGET'][:] = fiberpos['X'][ii]
fibermap['Y_TARGET'][:] = fiberpos['Y'][ii]
fibermap['X_FVCOBS'][:] = fiberpos['X'][ii]
fibermap['Y_FVCOBS'][:] = fiberpos['Y'][ii]
fibermap['POSITIONER'][:] = fiberpos['LOCATION'][ii] #- deprecated
fibermap['LOCATION'][:] = fiberpos['LOCATION'][ii]
fibermap['PETAL_LOC'][:] = fiberpos['PETAL'][ii]
fibermap['DEVICE_LOC'][:] = fiberpos['DEVICE'][ii]
fibermap['LAMBDAREF'][:] = 5400.0

assert set(fibermap.keys()) == set([x[0] for x in fibermap_columns])

return fibermap

Expand Down

0 comments on commit d7b5ad5

Please sign in to comment.