Skip to content

Commit

Permalink
rename hit rate
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Jun 26, 2024
1 parent b14025f commit 9e3b411
Showing 1 changed file with 6 additions and 6 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

0 comments on commit 9e3b411

Please sign in to comment.