Skip to content

Commit

Permalink
bugfix: in the vectorized get_dark_cal_id, if result is a scalar, con…
Browse files Browse the repository at this point in the history
…vert to underlying type
  • Loading branch information
javierggt committed Jul 8, 2022
1 parent e62227a commit 856a0c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mica/archive/aca_dark/dark_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ def get_dark_cal_id(date, select='before'):
:returns: dark cal id string (YYYYDOY)
"""
return _get_dark_cal_id_vector(date, select=select)
dark_id = _get_dark_cal_id_vector(date, select=select)
if not dark_id.shape:
# returning an instance of the type, not a numpy array
return dark_id.dtype.type(dark_id)
return dark_id


def _get_dark_cal_id_scalar(date, select='before'):
Expand Down

0 comments on commit 856a0c6

Please sign in to comment.