Skip to content

Commit

Permalink
Fix bug when masking between doys on dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptiste Hamon committed Jan 28, 2025
1 parent 0c815b9 commit c52cd63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/xclim/core/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,8 @@ def mask_between_doys(
mask = (days >= start_d) & (days <= end_d)
else:
# Get an array with the good shape and put False
mask = xr.where(group.isel(time=0), False, False)
mask = start.isel(time=0).drop_vars("time").expand_dims(time=group.time)
mask = xr.full_like(mask, False)

out.append(mask)
mask = xr.concat(out, dim="time")
Expand Down

0 comments on commit c52cd63

Please sign in to comment.