From 23a69653c39680fad16f5c97dca74f4e07eb3187 Mon Sep 17 00:00:00 2001
From: erexer <13180883+erexer@users.noreply.github.com>
Date: Wed, 18 Oct 2023 13:54:24 -0700
Subject: [PATCH] update intro.ipynb
---
intro.ipynb | 678 +++++++++++++++++-----------------------------------
1 file changed, 219 insertions(+), 459 deletions(-)
diff --git a/intro.ipynb b/intro.ipynb
index 2d25d1157d..975de83a2f 100644
--- a/intro.ipynb
+++ b/intro.ipynb
@@ -125,7 +125,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 8,
"id": "ab26ed3a-61d4-4126-80dd-752cadc12f6e",
"metadata": {},
"outputs": [],
@@ -136,7 +136,7 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 9,
"id": "4498eec3-0786-4318-95ae-fe03ba42e605",
"metadata": {
"tags": []
@@ -150,7 +150,7 @@
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 10,
"id": "f170e200-4e94-476a-baaa-e322300eee05",
"metadata": {},
"outputs": [],
@@ -163,7 +163,7 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 11,
"id": "aac24c35-28c4-415a-ba10-478886d15713",
"metadata": {
"scrolled": true,
@@ -176,49 +176,14 @@
"raupach_displacement_height = nodes.raupach_displacement_height(building_height, frontal_area_index)\n",
"raupach_roughness_length = nodes.raupach_roughness_length(building_height, frontal_area_index, raupach_displacement_height)\n",
"macdonald_displacement_height = nodes.macdonald_displacement_height(building_height, plan_area_fraction)\n",
- "macdonald_roughness_length = nodes.macdonald_roughness_length(building_height, macdonald_displacement_height, frontal_area_index)\n",
+ "macdonald_roughness_length = nodes.macdonald_roughness_length(building_height, macdonald_displacement_height, frontal_area, lot_area)\n",
"vertical_distribution_of_building_heights = nodes.vertical_distribution_of_building_heights(building_height)"
]
},
- {
- "cell_type": "code",
- "execution_count": 11,
- "id": "6c2e11b6-9fb6-4f1d-af4f-fcae87aa510b",
- "metadata": {
- "scrolled": true,
- "tags": []
- },
- "outputs": [],
- "source": [
- "# Merge all calculated parameters into one GeoDataFrame\n",
- "merge_parameters = nodes.merge_parameters(\n",
- " frontal_area_density,\n",
- " plan_area_density,\n",
- " rooftop_area_density,\n",
- " plan_area_fraction,\n",
- " mean_building_height,\n",
- " standard_deviation_of_building_heights,\n",
- " area_weighted_mean_of_building_heights,\n",
- " building_surface_area_to_plan_area_ratio,\n",
- " frontal_area_index,\n",
- " complete_aspect_ratio,\n",
- " height_to_width_ratio,\n",
- " sky_view_factor,\n",
- " grimmond_oke_roughness_length,\n",
- " grimmond_oke_displacement_height,\n",
- " raupach_roughness_length,\n",
- " raupach_displacement_height,\n",
- " macdonald_roughness_length,\n",
- " macdonald_displacement_height,\n",
- " vertical_distribution_of_building_heights,\n",
- " building_geometry,\n",
- " target_crs,)"
- ]
- },
{
"cell_type": "code",
"execution_count": 12,
- "id": "c38dd0e9-87f0-4b49-8992-45d1c36352d1",
+ "id": "8ab5cf0c-db6a-4c4c-8cac-eb0334fdd2f2",
"metadata": {},
"outputs": [
{
@@ -242,149 +207,47 @@
" \n",
" \n",
" \n",
" \n",
" \n",
- " frontal_area_north_0 \n",
- " frontal_area_north_1 \n",
- " frontal_area_north_2 \n",
- " frontal_area_north_3 \n",
- " frontal_area_north_4 \n",
- " frontal_area_north_5 \n",
- " frontal_area_north_6 \n",
- " frontal_area_north_7 \n",
- " frontal_area_north_8 \n",
- " frontal_area_north_9 \n",
- " ... \n",
- " vertical_distribution_of_building_heights_6 \n",
- " vertical_distribution_of_building_heights_7 \n",
- " vertical_distribution_of_building_heights_8 \n",
- " vertical_distribution_of_building_heights_9 \n",
- " vertical_distribution_of_building_heights_10 \n",
- " vertical_distribution_of_building_heights_11 \n",
- " vertical_distribution_of_building_heights_12 \n",
- " vertical_distribution_of_building_heights_13 \n",
- " vertical_distribution_of_building_heights_14 \n",
- " building_geometry \n",
+ " raupach_displacement_height_north \n",
+ " raupach_displacement_height_east \n",
+ " raupach_displacement_height_south \n",
+ " raupach_displacement_height_west \n",
"
192 rows × 133 columns
\n", + "192 rows × 4 columns
\n", "" ], "text/plain": [ - " frontal_area_north_0 frontal_area_north_1 frontal_area_north_2 \\\n", - "0 0.001903 0.000000 0.000000 \n", - "1 0.002208 0.000000 0.000000 \n", - "2 0.019133 0.019133 0.019133 \n", - "3 0.023445 0.023445 0.009331 \n", - "4 0.036085 0.036085 0.018620 \n", - ".. ... ... ... \n", - "187 0.072072 0.000000 0.000000 \n", - "188 0.002350 0.000000 0.000000 \n", - "189 0.042610 0.042610 0.025907 \n", - "190 0.003648 0.003648 0.003648 \n", - "191 0.032901 0.015003 0.000000 \n", - "\n", - " frontal_area_north_3 frontal_area_north_4 frontal_area_north_5 \\\n", - "0 0.000000 0.000000 0.000000 \n", - "1 0.000000 0.000000 0.000000 \n", - "2 0.019133 0.019133 0.001569 \n", - "3 0.000000 0.000000 0.000000 \n", - "4 0.000000 0.000000 0.000000 \n", - ".. ... ... ... \n", - "187 0.000000 0.000000 0.000000 \n", - "188 0.000000 0.000000 0.000000 \n", - "189 0.000000 0.000000 0.000000 \n", - "190 0.003648 0.003648 0.003648 \n", - "191 0.000000 0.000000 0.000000 \n", - "\n", - " frontal_area_north_6 frontal_area_north_7 frontal_area_north_8 \\\n", - "0 0.000000 0.000000 0 \n", - "1 0.000000 0.000000 0 \n", - "2 0.000000 0.000000 0 \n", - "3 0.000000 0.000000 0 \n", - "4 0.000000 0.000000 0 \n", - ".. ... ... ... \n", - "187 0.000000 0.000000 0 \n", - "188 0.000000 0.000000 0 \n", - "189 0.000000 0.000000 0 \n", - "190 0.003648 0.000752 0 \n", - "191 0.000000 0.000000 0 \n", - "\n", - " frontal_area_north_9 ... vertical_distribution_of_building_heights_6 \\\n", - "0 0 ... 0.0 \n", - "1 0 ... 0.0 \n", - "2 0 ... 0.0 \n", - "3 0 ... 0.0 \n", - "4 0 ... 0.0 \n", - ".. ... ... ... \n", - "187 0 ... 0.0 \n", - "188 0 ... 0.0 \n", - "189 0 ... 0.0 \n", - "190 0 ... 1.0 \n", - "191 0 ... 0.0 \n", - "\n", - " vertical_distribution_of_building_heights_7 \\\n", - "0 0.0 \n", - "1 0.0 \n", - "2 0.0 \n", - "3 0.0 \n", - "4 0.0 \n", - ".. ... \n", - "187 0.0 \n", - "188 0.0 \n", - "189 0.0 \n", - "190 1.0 \n", - "191 0.0 \n", - "\n", - " vertical_distribution_of_building_heights_8 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " raupach_displacement_height_north raupach_displacement_height_east \\\n", + "0 0.212556 0.210756 \n", + "1 0.228000 0.226077 \n", + "2 10.658445 10.117350 \n", + "3 4.145567 4.134151 \n", + "4 5.155915 4.968264 \n", + ".. ... ... \n", + "187 1.872377 1.551215 \n", + "188 0.212719 0.251011 \n", + "189 5.717203 5.120082 \n", + "190 9.274510 10.429185 \n", + "191 2.371074 1.998763 \n", "\n", - " vertical_distribution_of_building_heights_9 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", + " raupach_displacement_height_south raupach_displacement_height_west \n", + "0 0.215884 0.210707 \n", + "1 0.231553 0.226025 \n", + "2 10.408661 9.658848 \n", + "3 4.228290 4.232183 \n", + "4 5.172117 4.853836 \n", + ".. ... ... \n", + "187 1.872176 1.551203 \n", + "188 0.211143 0.251006 \n", + "189 5.710287 5.122209 \n", + "190 9.358159 10.231708 \n", + "191 2.369241 1.999447 \n", "\n", - " vertical_distribution_of_building_heights_10 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", - "\n", - " vertical_distribution_of_building_heights_11 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", - "\n", - " vertical_distribution_of_building_heights_12 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", - "\n", - " vertical_distribution_of_building_heights_13 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", - "\n", - " vertical_distribution_of_building_heights_14 \\\n", - "0 0 \n", - "1 0 \n", - "2 0 \n", - "3 0 \n", - "4 0 \n", - ".. ... \n", - "187 0 \n", - "188 0 \n", - "189 0 \n", - "190 0 \n", - "191 0 \n", - "\n", - " building_geometry \n", - "0 POLYGON ((1618052.020 1922797.834, 1618051.749... \n", - "1 POLYGON ((1618059.647 1922806.024, 1618058.415... \n", - "2 POLYGON ((1620424.742 1923453.039, 1620423.981... \n", - "3 POLYGON ((1619893.556 1923694.814, 1619890.578... \n", - "4 POLYGON ((1620091.602 1923651.742, 1620152.861... \n", - ".. ... \n", - "187 POLYGON ((1619442.911 1923341.729, 1619441.670... \n", - "188 POLYGON ((1619519.989 1923844.352, 1619520.277... \n", - "189 POLYGON ((1619448.266 1923520.007, 1619446.211... \n", - "190 POLYGON ((1618967.172 1923713.151, 1618967.258... \n", - "191 POLYGON ((1619357.797 1923445.956, 1619344.502... \n", - "\n", - "[192 rows x 133 columns]" + "[192 rows x 4 columns]" ] }, "execution_count": 12, @@ -713,6 +331,148 @@ "output_type": "execute_result" } ], + "source": [ + "raupach_displacement_height" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "6c2e11b6-9fb6-4f1d-af4f-fcae87aa510b", + "metadata": { + "scrolled": true, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Unexpected exception formatting exception. Falling back to standard exception\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Traceback (most recent call last):\n", + " File \"/Users/rexe871/.local/share/virtualenvs/naturf-3Df4Akd_/lib/python3.11/site-packages/pandas/core/indexes/base.py\", line 3790, in get_loc\n", + " return self._engine.get_loc(casted_key)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"index.pyx\", line 152, in pandas._libs.index.IndexEngine.get_loc\n", + " File \"index.pyx\", line 181, in pandas._libs.index.IndexEngine.get_loc\n", + " File \"pandas/_libs/hashtable_class_helper.pxi\", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item\n", + " File \"pandas/_libs/hashtable_class_helper.pxi\", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item\n", + "KeyError: 'raupach_displacement_height_north'\n", + "\n", + "The above exception was the direct cause of the following exception:\n", + "\n", + "Traceback (most recent call last):\n", + " File \"/Users/rexe871/.local/share/virtualenvs/naturf-3Df4Akd_/lib/python3.11/site-packages/IPython/core/interactiveshell.py\", line 3526, in run_code\n", + " exec(code_obj, self.user_global_ns, self.user_ns)\n", + " File \"/var/folders/dj/xj66c8yj0tx9drsm5hvbvlf40000gn/T/ipykernel_26781/419751867.py\", line 2, in