Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Jul 19, 2023
1 parent 2b53053 commit a9113c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion notebooks/wp4/clima_and_bias_cordex_cmip6_regionalised.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@
" else:\n",
" # Select years (shift -1 to get D(year-1)J(year)F(year))\n",
" ds = ds.assign_coords(year=ds[\"time\"].dt.year.shift(time=-1))\n",
" mask = (ds[\"year\"] >= year_start) & (ds[\"year\"] <= year_stop)\n",
" mask = (\n",
" (ds[\"year\"] >= year_start)\n",
" & (ds[\"year\"] <= year_stop)\n",
" & (ds[\"time\"].dt.season == timeseries)\n",
" )\n",
" ds = ds.where(mask.compute(), drop=True)\n",
" if not ds.sizes[\"time\"]:\n",
" # Return empty dataset. Previous year needed for DJF only.\n",
Expand Down

0 comments on commit a9113c3

Please sign in to comment.