Skip to content

Commit

Permalink
Enable seasonal scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
saschahofmann committed Jan 16, 2025
1 parent 2ebd4b8 commit 835ee16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/xclim/sdba/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ def broadcast(
sel.update({group.prop: group.get_index(x, interp=interp != "nearest")})

if sel:
if group.prop == "season":
grouped = grouped.assign_coords(season=map_season_to_int(grouped.season))
# Extract the correct mean factor for each time step.
if interp == "nearest": # Interpolate both the time group and the quantile.
grouped = grouped.sel(sel, method="nearest")
Expand Down

0 comments on commit 835ee16

Please sign in to comment.