Skip to content

Commit

Permalink
Make sure doy uses integer arrays. Fix #123
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Paulik authored and cpaulik committed Feb 6, 2018
1 parent a83d9c5 commit eaaa817
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pytesmo/timedate/julian.py
Expand Up @@ -303,8 +303,9 @@ def doy(month, day, year=None):

if year is not None:
nonleap_years = np.invert(is_leap_year(year))
day_of_year = day_of_year - nonleap_years + \
np.logical_and(day_of_year < 60, nonleap_years)
day_of_year = (day_of_year -
nonleap_years.astype('int') +
np.logical_and(day_of_year < 60, nonleap_years).astype('int'))

return day_of_year

Expand Down

0 comments on commit eaaa817

Please sign in to comment.