Skip to content

Commit

Permalink
Merge branch 'main' into earthkit
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Jun 27, 2024
2 parents 45c7756 + 1b0ef82 commit b3a0303
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions notebooks/wp3/hit_rate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
" return ds\n",
"\n",
"\n",
"def compute_tercile_occupation(ds, region, defined_regions_module_name, detrend):\n",
"def tercile_analysis(ds, region, defined_regions_module_name, detrend):\n",
" # Mask region\n",
" defined_regions = get_defined_regions(defined_regions_module_name)\n",
" mask = defined_regions.mask(ds)\n",
Expand Down Expand Up @@ -303,7 +303,7 @@
" request_reanalysis | {\"variable\": variable},\n",
" chunks=chunks,\n",
" transform_chunks=False,\n",
" transform_func=compute_tercile_occupation,\n",
" transform_func=tercile_analysis,\n",
" transform_func_kwargs={\n",
" \"region\": region,\n",
" \"defined_regions_module_name\": defined_regions_module_name,\n",
Expand Down Expand Up @@ -352,7 +352,7 @@
" | request_kwargs,\n",
" chunks=chunks,\n",
" transform_chunks=False,\n",
" transform_func=compute_tercile_occupation,\n",
" transform_func=tercile_analysis,\n",
" transform_func_kwargs={\n",
" \"region\": region,\n",
" \"defined_regions_module_name\": defined_regions_module_name,\n",
Expand Down Expand Up @@ -442,7 +442,7 @@
"metadata": {},
"outputs": [],
"source": [
"def plot_tercile_occupations(da, **kwargs):\n",
"def plot_tercile_analysis(da, **kwargs):\n",
" cmap = kwargs.pop(\"cmap\", \"RdYlBu_r\")\n",
" kwargs[\"cmap\"] = plt.get_cmap(cmap, 3)\n",
" cbar_kwargs = {\"ticks\": [-2 / 3, 0, 2 / 3]}\n",
Expand Down Expand Up @@ -470,14 +470,14 @@
"centre = \"cmcc\"\n",
"assert (variable in variables) and (region in regions) and (centre in centres)\n",
"\n",
"plot_tercile_occupations(\n",
"plot_tercile_analysis(\n",
" ds_reanalysis[variable].sel(region=region),\n",
" xticks=range(1, 13),\n",
")\n",
"plt.suptitle(\"ERA5\")\n",
"plt.show()\n",
"\n",
"facet = plot_tercile_occupations(\n",
"facet = plot_tercile_analysis(\n",
" ds_seasonal[variable].sel(region=region, centre=centre),\n",
" col=\"valid_year\",\n",
" col_wrap=5,\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/wp5/satellite_esacci_gmpe_timeseries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"# Time\n",
"# Note: Time period from December year_start-1 to November year_stop\n",
"year_start = 1982\n",
"year_stop = 2011\n",
"year_stop = 2016\n",
"\n",
"# Regions\n",
"regions = {\n",
Expand Down
4 changes: 2 additions & 2 deletions notebooks/wp5/satellite_esacci_gmpe_variability.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
" **kwargs,\n",
" requests=annual_requests,\n",
" transform_func=compute_time_reductions,\n",
" transform_func_kwargs={\"func\": func, \"weights\": False},\n",
" transform_func_kwargs={\"func\": func, \"weights\": False, \"skipna\": False},\n",
" )\n",
" tmp_ds_list.append(rechunk(ds).expand_dims(reduction=[reduction]))\n",
" annual_ds_list.append(\n",
Expand Down Expand Up @@ -308,7 +308,7 @@
" **kwargs,\n",
" requests=season_requests,\n",
" transform_func=compute_time_reductions,\n",
" transform_func_kwargs={\"func\": func, \"weights\": False},\n",
" transform_func_kwargs={\"func\": func, \"weights\": False, \"skipna\": False},\n",
" )\n",
" tmp_ds_list.append(rechunk(ds).expand_dims(reduction=[reduction]))\n",
" seasonal_ds_list.append(xr.concat(tmp_ds_list, \"reduction\"))\n",
Expand Down

0 comments on commit b3a0303

Please sign in to comment.