Skip to content

Commit

Permalink
minor text and variable name updates
Browse files Browse the repository at this point in the history
still need to fix the mask rasters image, not rendering
  • Loading branch information
bhass-neon committed Aug 28, 2023
1 parent 147cd43 commit 46b3acf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14624,7 +14624,7 @@ <h2 id="urlTitle:-mask-rasters-py">urlTitle: mask-rasters-py<a class="anchor-lin

### Download Data

For this lesson, we will read in a Canopy Height Model data collected at NEON's <a href="https://www.neonscience.org/field-sites/teak" target="_blank">Lower Teakettle (TEAK)</a> site in California. This data is downloaded in the first part of the tutorial, using the Python `requests` package.
For this lesson, we will read in Canopy Height Model data collected at NEON's <a href="https://www.neonscience.org/field-sites/teak" target="_blank">Lower Teakettle (TEAK)</a> site in California. This data is downloaded in the first part of the tutorial, using the Python `requests` package.

</div><p><img src="http://neon-workwithdata.github.io/neon-data-institute-2016/images/spatialData/raster_masks.jpg" style="width: 750px;"/></p>

Expand Down Expand Up @@ -15058,11 +15058,11 @@ <h2 id="Mask-Data-by-Aspect-and-NDVI">Mask Data by Aspect and NDVI<a class="anch
<div class="jp-CodeMirrorEditor jp-Editor jp-InputArea-editor" data-type="inline">
<div class="CodeMirror cm-s-jupyter">
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1">#Now include additional requirement that slope is North-facing (i.e. aspectNS_array = 1)</span>
<span class="n">ndvi_gtpt4_Nslope</span> <span class="o">=</span> <span class="n">ndvi_gtpt4</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
<span class="n">ndvi_gtpt4_Nslope</span><span class="p">[</span><span class="n">aspect_reclass</span> <span class="o">!=</span> <span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span>
<span class="n">ndvi_gtpt4_north</span> <span class="o">=</span> <span class="n">ndvi_gtpt4</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
<span class="n">ndvi_gtpt4_north</span><span class="p">[</span><span class="n">aspect_reclass</span> <span class="o">!=</span> <span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span>

<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="mi">6</span><span class="p">))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">ndvi_gtpt4_Nslope</span><span class="p">,</span><span class="n">extent</span><span class="o">=</span><span class="n">ext</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">ndvi_gtpt4_north</span><span class="p">,</span><span class="n">extent</span><span class="o">=</span><span class="n">ext</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">colorbar</span><span class="p">();</span> <span class="n">plt</span><span class="o">.</span><span class="n">set_cmap</span><span class="p">(</span><span class="s1">&#39;RdYlGn&#39;</span><span class="p">);</span>
<span class="n">plt</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s1">&#39;TEAK, North Facing &amp; NDVI &gt; 0.4&#39;</span><span class="p">)</span>
<span class="n">ax</span><span class="o">=</span><span class="n">plt</span><span class="o">.</span><span class="n">gca</span><span class="p">();</span> <span class="n">ax</span><span class="o">.</span><span class="n">ticklabel_format</span><span class="p">(</span><span class="n">useOffset</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="s1">&#39;plain&#39;</span><span class="p">)</span> <span class="c1">#do not use scientific notation </span>
Expand Down Expand Up @@ -15100,6 +15100,7 @@ <h2 id="Mask-Data-by-Aspect-and-NDVI">Mask Data by Aspect and NDVI<a class="anch
<span class="n">ndvi_gtpt4_south</span> <span class="o">=</span> <span class="n">ndvi_gtpt4</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
<span class="n">ndvi_gtpt4_south</span><span class="p">[</span><span class="n">aspect_reclass</span> <span class="o">!=</span> <span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nan</span>

<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span><span class="mi">6</span><span class="p">))</span>
<span class="n">plt</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">ndvi_gtpt4_south</span><span class="p">,</span><span class="n">extent</span><span class="o">=</span><span class="n">ext</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">colorbar</span><span class="p">();</span> <span class="n">plt</span><span class="o">.</span><span class="n">set_cmap</span><span class="p">(</span><span class="s1">&#39;RdYlGn&#39;</span><span class="p">);</span>
<span class="n">plt</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s1">&#39;TEAK, South Facing &amp; NDVI &gt; 0.4&#39;</span><span class="p">)</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"\n",
"### Download Data\n",
"\n",
"For this lesson, we will read in a Canopy Height Model data collected at NEON's <a href=\"https://www.neonscience.org/field-sites/teak\" target=\"_blank\">Lower Teakettle (TEAK)</a> site in California. This data is downloaded in the first part of the tutorial, using the Python `requests` package.\n",
"For this lesson, we will read in Canopy Height Model data collected at NEON's <a href=\"https://www.neonscience.org/field-sites/teak\" target=\"_blank\">Lower Teakettle (TEAK)</a> site in California. This data is downloaded in the first part of the tutorial, using the Python `requests` package.\n",
"\n",
"</div>\n",
"\n",
Expand Down Expand Up @@ -342,11 +342,11 @@
"outputs": [],
"source": [
"#Now include additional requirement that slope is North-facing (i.e. aspectNS_array = 1)\n",
"ndvi_gtpt4_Nslope = ndvi_gtpt4.copy()\n",
"ndvi_gtpt4_Nslope[aspect_reclass != 1] = np.nan\n",
"ndvi_gtpt4_north = ndvi_gtpt4.copy()\n",
"ndvi_gtpt4_north[aspect_reclass != 1] = np.nan\n",
"\n",
"fig, ax = plt.subplots(1, 1, figsize=(6,6))\n",
"plt.imshow(ndvi_gtpt4_Nslope,extent=ext)\n",
"plt.imshow(ndvi_gtpt4_north,extent=ext)\n",
"plt.colorbar(); plt.set_cmap('RdYlGn'); \n",
"plt.title('TEAK, North Facing & NDVI > 0.4')\n",
"ax=plt.gca(); ax.ticklabel_format(useOffset=False, style='plain') #do not use scientific notation \n",
Expand All @@ -373,6 +373,7 @@
"ndvi_gtpt4_south = ndvi_gtpt4.copy()\n",
"ndvi_gtpt4_south[aspect_reclass != 2] = np.nan\n",
"\n",
"fig, ax = plt.subplots(1, 1, figsize=(6,6))\n",
"plt.imshow(ndvi_gtpt4_south,extent=ext)\n",
"plt.colorbar(); plt.set_cmap('RdYlGn'); \n",
"plt.title('TEAK, South Facing & NDVI > 0.4')\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ After completing this tutorial, you will be able to:

### Download Data

For this lesson, we will read in a Canopy Height Model data collected at NEON's <a href="https://www.neonscience.org/field-sites/teak" target="_blank">Lower Teakettle (TEAK)</a> site in California. This data is downloaded in the first part of the tutorial, using the Python `requests` package.
For this lesson, we will read in Canopy Height Model data collected at NEON's <a href="https://www.neonscience.org/field-sites/teak" target="_blank">Lower Teakettle (TEAK)</a> site in California. This data is downloaded in the first part of the tutorial, using the Python `requests` package.

</div>

Expand Down Expand Up @@ -224,11 +224,11 @@ rotatexlabels = plt.setp(ax.get_xticklabels(),rotation=90) #rotate x tick labels

```python
#Now include additional requirement that slope is North-facing (i.e. aspectNS_array = 1)
ndvi_gtpt4_Nslope = ndvi_gtpt4.copy()
ndvi_gtpt4_Nslope[aspect_reclass != 1] = np.nan
ndvi_gtpt4_north = ndvi_gtpt4.copy()
ndvi_gtpt4_north[aspect_reclass != 1] = np.nan

fig, ax = plt.subplots(1, 1, figsize=(6,6))
plt.imshow(ndvi_gtpt4_Nslope,extent=ext)
plt.imshow(ndvi_gtpt4_north,extent=ext)
plt.colorbar(); plt.set_cmap('RdYlGn');
plt.title('TEAK, North Facing & NDVI > 0.4')
ax=plt.gca(); ax.ticklabel_format(useOffset=False, style='plain') #do not use scientific notation
Expand All @@ -246,6 +246,7 @@ Let's also look at where NDVI > 0.4 on south facing slopes.
ndvi_gtpt4_south = ndvi_gtpt4.copy()
ndvi_gtpt4_south[aspect_reclass != 2] = np.nan

fig, ax = plt.subplots(1, 1, figsize=(6,6))
plt.imshow(ndvi_gtpt4_south,extent=ext)
plt.colorbar(); plt.set_cmap('RdYlGn');
plt.title('TEAK, South Facing & NDVI > 0.4')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#
# ### Download Data
#
# For this lesson, we will read in a Canopy Height Model data collected at NEON's <a href="https://www.neonscience.org/field-sites/teak" target="_blank">Lower Teakettle (TEAK)</a> site in California. This data is downloaded in the first part of the tutorial, using the Python `requests` package.
# For this lesson, we will read in Canopy Height Model data collected at NEON's <a href="https://www.neonscience.org/field-sites/teak" target="_blank">Lower Teakettle (TEAK)</a> site in California. This data is downloaded in the first part of the tutorial, using the Python `requests` package.
#
# </div>
#
Expand Down Expand Up @@ -240,11 +240,11 @@ def download_url(url,download_dir):


#Now include additional requirement that slope is North-facing (i.e. aspectNS_array = 1)
ndvi_gtpt4_Nslope = ndvi_gtpt4.copy()
ndvi_gtpt4_Nslope[aspect_reclass != 1] = np.nan
ndvi_gtpt4_north = ndvi_gtpt4.copy()
ndvi_gtpt4_north[aspect_reclass != 1] = np.nan

fig, ax = plt.subplots(1, 1, figsize=(6,6))
plt.imshow(ndvi_gtpt4_Nslope,extent=ext)
plt.imshow(ndvi_gtpt4_north,extent=ext)
plt.colorbar(); plt.set_cmap('RdYlGn');
plt.title('TEAK, North Facing & NDVI > 0.4')
ax=plt.gca(); ax.ticklabel_format(useOffset=False, style='plain') #do not use scientific notation
Expand All @@ -263,6 +263,7 @@ def download_url(url,download_dir):
ndvi_gtpt4_south = ndvi_gtpt4.copy()
ndvi_gtpt4_south[aspect_reclass != 2] = np.nan

fig, ax = plt.subplots(1, 1, figsize=(6,6))
plt.imshow(ndvi_gtpt4_south,extent=ext)
plt.colorbar(); plt.set_cmap('RdYlGn');
plt.title('TEAK, South Facing & NDVI > 0.4')
Expand Down

0 comments on commit 46b3acf

Please sign in to comment.