Skip to content

Commit

Permalink
Handle zero length arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
schlafly committed Jan 19, 2021
1 parent f551578 commit 843f799
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions py/desisurvey/tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ def airmass_at_mjd(self, mjd, mask=None):
array
Array of airmasses corresponding to each input hour angle.
"""
if len(mjd) == 0:
return np.zeros(0, dtype='f8')
tt = Time(mjd, format='mjd', location=desisurvey.utils.get_location())
lst = tt.sidereal_time('apparent').to(u.deg).value

Expand Down

0 comments on commit 843f799

Please sign in to comment.