Skip to content

Commit 31767ad

Browse files
author
priyankatuteja
committed
changes incorporated
1 parent f63cd5e commit 31767ad

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

samples/04_gis_analysts_data_scientists/predict-floods-with-unit-hydrographs.ipynb

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@
108108
"metadata": {},
109109
"outputs": [],
110110
"source": [
111-
"gis = GIS('https://pythonapi.playground.esri.com/portal',\n",
112-
" 'arcgis_python',\n",
113-
" 'amazing_arcgis_123',\n",
114-
" \"your_enterprise_profile\")"
111+
"gis = GIS(profile=\"your_enterprise_profile\")"
115112
]
116113
},
117114
{
@@ -392,7 +389,7 @@
392389
"cell_type": "markdown",
393390
"metadata": {},
394391
"source": [
395-
"Before you begin your analysis, you'll precondition a digital elevation model (DEM) of Stowe, Vermont, to reduce the possibility of errors in your results. Some DEMs contain sinks, which are areas of low elevation surrounded by higher elevation values. Sinks can occur naturally but are more often data errors in a DEM raster dataset. Because water has no way of flowing out of a sink, sinks can cause all kinds of errors when analyzing how water flows to an outlet. Before you begin your hydrological analysis of flooding potential in Stowe, you'll identify and remove sinks from your elevation data."
392+
"Some DEMs contain sinks, which are areas of low elevation surrounded by higher elevation values. Sinks can occur naturally but are more often data errors in a DEM raster dataset. Because water has no way of flowing out of a sink, sinks can cause all kinds of errors when analyzing how water flows to an outlet. Before you begin your hydrological analysis of flooding potential in Stowe, you'll identify and remove sinks from your elevation data."
396393
]
397394
},
398395
{
@@ -588,7 +585,7 @@
588585
"cell_type": "markdown",
589586
"metadata": {},
590587
"source": [
591-
"This map contains mostly small groups of black pixels, might be difficult to see with its default symbology. You'll change the symbology to make the sinks easier to see."
588+
"This map contains mostly small groups of black pixels, which might be difficult to see with its default symbology. You'll change the symbology to make the sinks easier to see."
592589
]
593590
},
594591
{
@@ -658,7 +655,7 @@
658655
"cell_type": "markdown",
659656
"metadata": {},
660657
"source": [
661-
"Sinks seem to appear primarily around stream networks and water bodies identified by the `Stowe_surface_water` layer. Existing water tends to be flat and can cause errors in a DEM, such as sinks."
658+
"Sinks seem to appear primarily around stream networks and water bodies identified by the `Stowe_surface_water` layer. Existing water bodies tends to be flat and can cause errors in a DEM, such as sinks."
662659
]
663660
},
664661
{
@@ -699,7 +696,7 @@
699696
"cell_type": "markdown",
700697
"metadata": {},
701698
"source": [
702-
"Now that you've identified where sinks exist in your DEM, you'll create a DEM with the sinks removed. In your new DEM, all sinks will be changed to have the elevation value of the lowest cell next to the sink. Each cell in the new DEM will be part of at least one continuous decreasing path of cells leading to an edge of the dataset. This new DEM will allow for more accurate hydrological analysis of the Stowe region."
699+
"Now that you've identified where sinks exist in your DEM, you'll create a DEM with the sinks removed using `arcgis.raster.functions.gbl.fill(input_surface_raster, zlimit=None)`. In your new DEM, all sinks will be changed to have the elevation value of the lowest cell next to the sink. Each cell in the new DEM will be part of at least one continuous decreasing path of cells leading to an edge of the dataset. This new DEM will allow for more accurate hydrological analysis of the Stowe region."
703700
]
704701
},
705702
{
@@ -715,7 +712,7 @@
715712
"cell_type": "markdown",
716713
"metadata": {},
717714
"source": [
718-
"The final parameter, **Z limit**, allows you to set a maximum elevation difference at which to fill sinks. If the difference in elevation between a sink and its edge is above the limit, the sink won't be filled. You want to fill all of the sinks in your data, so you'll leave this parameter unchanged."
715+
"The final parameter, **Z limit**, allows you to set a maximum elevation difference (between a sink and its pour point) at which to fill sinks. If the difference in elevation between a sink and its edge is above the limit, the sink won't be filled. You want to fill all of the sinks in your data, so you'll leave this parameter unchanged."
719716
]
720717
},
721718
{
@@ -772,7 +769,7 @@
772769
"cell_type": "markdown",
773770
"metadata": {},
774771
"source": [
775-
"You've used a series of raster tools to identify sinks within a raw DEM. You also inspected the sinks and found that most of them occurred on or close to surface water bodies, likely due to insufficient elevation data. Lastly, you filled the sinks in the dataset. Next, you'll use your new DEM to determine the watershed that spans Stowe. Knowing this watershed will help you determine how water will accumulate around the town."
772+
"You've used a series of raster tools to identify sinks within a raw DEM. By inspecting the sinks, you might have also found that most of them occurred on or close to surface water bodies, likely due to insufficient elevation data. Lastly, you have filled the sinks in the dataset. Next, the newly created DEM is to be used to determine the watershed that spans Stowe, in order to help determine how water accumulates around the town."
776773
]
777774
},
778775
{
@@ -800,7 +797,7 @@
800797
"cell_type": "markdown",
801798
"metadata": {},
802799
"source": [
803-
"The first step to delineate a watershed is to determine the direction that water will flow in your DEM. That way, you can determine the areas where water will flow to the outlet. To do so, you'll create another flow direction raster layer, this time for your DEM with filled sinks."
800+
"The first step to delineate a watershed is to determine the direction that water will flow in your DEM. That way, you can determine the areas where water will flow to the outlet. To do so, you'll create another flow direction raster layer using [`flow_direction`](https://developers.arcgis.com/python/api-reference/arcgis.raster.functions.gbl.html?highlight=flow_direction#arcgis.raster.functions.gbl.flow_direction) tool, this time for your DEM with filled sinks. "
804801
]
805802
},
806803
{
@@ -809,7 +806,9 @@
809806
"metadata": {},
810807
"outputs": [],
811808
"source": [
812-
"stowe_fill_flow_direction = flow_direction(stowe_fill.layers[0]).save('Stowe_fill_flow_direction' + \n",
809+
"stowe_fill_flow_direction = flow_direction(stowe_fill.layers[0], \n",
810+
" flow_direction_type='D8', \n",
811+
" force_flow='NORMAL').save('Stowe_fill_flow_direction' + \n",
813812
" str(dt.now().microsecond))"
814813
]
815814
},
@@ -867,7 +866,7 @@
867866
"cell_type": "markdown",
868867
"metadata": {},
869868
"source": [
870-
"The cell values in a flow direction raster layer can normally be one of only eight integers: 1, 2, 4, 8, 16, 32, 64, and 128. These eight integers correspond to the eight possible flow directions (as any given cell is surrounded by eight cells). Your previous flow direction layer, however, had some values that weren't one of those eight integers. Those values belonged to the sinks that you later removed from the data. Because the original flow direction layer had a wide range of values, it was automatically symbolized based on a color ramp, which uses the default black-to-white color scheme. Your new flow direction layer only has eight values, so it was automatically symbolized with a unique color for each value."
869+
"The cell values in a flow direction raster layer can normally be one of only eight integers: 1, 2, 4, 8, 16, 32, 64, and 128 as shown [here](https://developers.arcgis.com/python/api-reference/_images/D8.gif). These eight integers correspond to the eight possible flow directions (as any given cell is surrounded by eight cells). Your previous flow direction layer, however, had some values that weren't one of those eight integers. Those values belonged to the sinks that you later removed from the data. Because the original flow direction layer had a wide range of values, it was automatically symbolized based on a color ramp, which uses the default black-to-white color scheme. Your new flow direction layer only has eight values, so it was automatically symbolized with a unique color for each value."
871870
]
872871
},
873872
{
@@ -904,7 +903,9 @@
904903
{
905904
"cell_type": "code",
906905
"execution_count": 208,
907-
"metadata": {},
906+
"metadata": {
907+
"scrolled": false
908+
},
908909
"outputs": [
909910
{
910911
"data": {
@@ -1141,7 +1142,7 @@
11411142
"cell_type": "markdown",
11421143
"metadata": {},
11431144
"source": [
1144-
"Previously, you created a watershed for the Stowe area, which you'll use as a study area for much of your subsequent analysis. Next, you'll start determining how long it takes water to reach the outlet, allowing the town to better predict when flooding will occur during a hypothetical rainfall event. To determine the time it takes water to flow somewhere, you first need to determine how fast water flows. You'll calculate the speed of flowing water with a velocity field, another type of raster layer. There are many types of velocity fields, and they can be calculated with a wide variety of mathematical equations. You'll create a velocity field that is spatially variant, but time and discharge invariant. This means that your velocity field makes the following assumptions:\n",
1145+
"Previously, you created a watershed for the Stowe area, which you'll use as a study area for much of your subsequent analysis. Next, you'll start determining how long it takes water to reach the outlet, allowing the town to better predict when flooding will occur during a hypothetical rainfall event. To determine the time it takes water to flow somewhere, you first need to determine how fast water flows. You'll calculate the speed of flowing water with a velocity field, another type of raster layer. There are many types of velocity fields, and they can be calculated with a wide variety of mathematical equations. You'll create a velocity field that is spatially variant, but time and discharge invariant. This means that your velocity field satisfies the following assumptions:\n",
11451146
"\n",
11461147
"- Velocity is affected by spatial components such as slope and flow - accumulation (spatially variant).\n",
11471148
"- Velocity at a given location does not change over time (time invariant).\n",
@@ -1184,14 +1185,14 @@
11841185
"cell_type": "markdown",
11851186
"metadata": {},
11861187
"source": [
1187-
"It calculates a raster layer where the value of each cell is that cell's slope. The slope is determined by the change in elevation between cells, so it requires your original elevation layer as an input."
1188+
"`slope` tool calculates slope value for each call of the given raster and creates a new raster layer with each cell representing th slope value corresponding to the original raster. The slope is determined by the change in elevation between cells, so it requires your original elevation layer as an input."
11881189
]
11891190
},
11901191
{
11911192
"cell_type": "markdown",
11921193
"metadata": {},
11931194
"source": [
1194-
"The Percent rise measurement option calculates slope as a percentage of vertical elevation over horizontal elevation, as opposed to a measurement in degrees. You'll leave the remaining parameters unchanged. The planar method is appropriate to use on local scale areas (small areas such as this watershed) where slope differences between planar and geodesic methods are minimal. The Z factor is only used if the units for measuring X and Y distance are different from the units for measuring Z (height) distance."
1195+
"`slope_type`=2 represents the Percent rise measurement option which calculates slope as a percentage of vertical elevation over horizontal elevation, as opposed to a measurement in degrees. You'll leave the remaining parameters unchanged. The planar method is appropriate to use on local scale areas (small areas such as this watershed) where slope differences between planar and geodesic methods are minimal. The Z factor is only used if the units for measuring X and Y distance are different from the units for measuring Z (height) distance."
11951196
]
11961197
},
11971198
{
@@ -1231,7 +1232,7 @@
12311232
"cell_type": "markdown",
12321233
"metadata": {},
12331234
"source": [
1234-
"The darker colors have a steeper slope. While the mountain peaks tend to have the highest slopes, the stream bed, around which the town is located, have a relatively flat slope."
1235+
"The darker colors represent steeper slope. While the mountain peaks tend to have the highest slopes, the stream bed, around which the town is located, have a relatively flat slope."
12351236
]
12361237
},
12371238
{
@@ -1272,7 +1273,7 @@
12721273
"cell_type": "markdown",
12731274
"metadata": {},
12741275
"source": [
1275-
"Now that you have a raster layer for both slope and flow accumulation area, you'll calculate a new raster layer that combines them. This layer will show the slope-area term (the value $S^b$$A^c$ from the Maidment et al. equation). `raster_calculator` tool, which allows you to create customized raster layers based on an equation that you specify."
1276+
"Now that you have a raster layer for both slope and flow accumulation area, you'll calculate a new raster layer that combines them. This layer will show the slope-area term (the value $S^b$$A^c$ from the Maidment et al. equation). `raster_calculator` tool allows you to create customized raster layers based on an equation that you specify."
12761277
]
12771278
},
12781279
{
@@ -1380,7 +1381,7 @@
13801381
"\n",
13811382
"V = $V_m$ ($S^b$$A^c$) / ($S^b$$A^c$$_m$) ------------- (1)\n",
13821383
"\n",
1383-
"As mentioned previously, $V_m$ is the average velocity of all cells in the watershed. You'll use an assumed average value of Vm = 0.1, which is recommended by Maidment et al. Similarly, $S^b$$A^c$$_m$ is the average slope-area term across the watershed. Because you've calculated slope-area term for the watershed, you can determine the exact average rather than relying on an assumed value."
1384+
"As mentioned previously, $V_m$ is the average velocity of all cells in the watershed. You'll use an assumed average value of $V_m$ = 0.1, which is recommended by Maidment et al. Similarly, $S^b$$A^c$$_m$ is the average slope-area term across the watershed. Because you've calculated slope-area term for the watershed, you can determine the exact average rather than relying on an assumed value."
13841385
]
13851386
},
13861387
{
@@ -1847,7 +1848,7 @@
18471848
"cell_type": "markdown",
18481849
"metadata": {},
18491850
"source": [
1850-
"We will use con tool tp clips a raster layer to a certain extent based on the extent of another layer."
1851+
"We will use con tool to clip a raster layer to a certain extent based on the extent of another layer."
18511852
]
18521853
},
18531854
{
@@ -1933,7 +1934,7 @@
19331934
"cell_type": "markdown",
19341935
"metadata": {},
19351936
"source": [
1936-
"You finally have all the layers you need to determine flow time. The next step of the task uses the `flow_length` tool. While this tool, as its name suggests, normally calculates flow length, it has an optional parameter to include a weight raster. When a weight raster is included, the tool calculates flow time instead."
1937+
"Finally you have gathered all layers needed to determine flow time, and the next step of the task would require you to use the `flow_length` tool. While this tool, as its name suggests, normally calculates flow length, it has an optional parameter to include a weight raster and whenever a weight raster is included, the tool then calculates flow time instead."
19371938
]
19381939
},
19391940
{
@@ -1990,7 +1991,7 @@
19901991
"cell_type": "markdown",
19911992
"metadata": {},
19921993
"source": [
1993-
"The time it takes water to flow to the outlet ranges from 0 seconds (rain that falls on the outlet itself) to about 47,000 seconds—over 13 hours!"
1994+
"The time it takes for water to flow to the outlet ranges from 0 seconds (rain that falls on the outlet itself) to about 47,000 seconds—over 13 hours!"
19941995
]
19951996
},
19961997
{
@@ -2774,7 +2775,7 @@
27742775
"cell_type": "markdown",
27752776
"metadata": {},
27762777
"source": [
2777-
"In this notebook, we have learnt how you can predict floods using unit hydrographs in order to plan for and respond to flood events more effectively."
2778+
"In this notebook, we have gained knowledege about various tools available in `arcgis.raster.functions` and `arcgis.raster.functions.gbl` module in order to predict floods using unit hydrographs in order to plan for and respond to flood events more effectively."
27782779
]
27792780
},
27802781
{

0 commit comments

Comments
 (0)