Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Dec 29, 2023
1 parent b65c055 commit e2e7326
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions notebooks/wp5/urban_heat_islands.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@
"metadata": {},
"outputs": [],
"source": [
"def regionalised_spatial_weighted_mean(ds, lon_slice=lon_slice, lat_slice=lat_slice):\n",
"def regionalised_func(ds, lon_slice, lat_slice, func):\n",
" ds = utils.regionalise(ds, lon_slice=lon_slice, lat_slice=lat_slice)\n",
" return diagnostics.spatial_weighted_mean(ds)"
" return func(ds)"
]
},
{
Expand Down Expand Up @@ -179,8 +179,12 @@
" albedo_timeseries_zoom[satellite] = download.download_and_transform(\n",
" collection_id_albedo,\n",
" request,\n",
" transform_func=regionalised_spatial_weighted_mean,\n",
" transform_func_kwargs={\"lon_slice\": lon_slice, \"lat_slice\": lat_slice},\n",
" transform_func=regionalised_func,\n",
" transform_func_kwargs={\n",
" \"lon_slice\": lon_slice,\n",
" \"lat_slice\": lat_slice,\n",
" \"func\": diagnostics.spatial_weighted_mean,\n",
" },\n",
" **albedo_kwargs,\n",
" )"
]
Expand Down Expand Up @@ -209,8 +213,12 @@
" temperature_timeseries_zoom[satellite] = download.download_and_transform(\n",
" collection_id_temperature,\n",
" request,\n",
" transform_func=regionalised_spatial_weighted_mean,\n",
" transform_func_kwargs={\"lon_slice\": lon_slice, \"lat_slice\": lat_slice},\n",
" transform_func=regionalised_func,\n",
" transform_func_kwargs={\n",
" \"lon_slice\": lon_slice,\n",
" \"lat_slice\": lat_slice,\n",
" \"func\": diagnostics.spatial_weighted_mean,\n",
" },\n",
" **temperature_kwargs,\n",
" )"
]
Expand Down

0 comments on commit e2e7326

Please sign in to comment.