Skip to content

Commit

Permalink
Doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidorme committed Oct 22, 2024
1 parent d55f553 commit d2857ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
34 changes: 17 additions & 17 deletions docs/source/users/demography/canopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ should equal the whole canopy $f_{abs}$ calculated using the simple Beer-Lambert
equation and the PFT trait values.

```{code-cell} ipython3
print(simple_canopy.extinction_profile[-1])
print(simple_canopy.community_data.extinction_profile[-1])
```

```{code-cell} ipython3
Expand Down Expand Up @@ -182,15 +182,15 @@ ax1.set_xlabel("Profile radius (m)")
ax1.set_ylabel("Vertical height (m)")
# Plot the leaf area between heights for stems
ax2.plot(simple_canopy.stem_leaf_area, hghts, color="red")
ax2.plot(simple_canopy.cohort_data.stem_leaf_area, hghts, color="red")
ax2.set_xlabel("Leaf area (m2)")
# Plot the fraction of light absorbed at different heights
ax3.plot(simple_canopy.f_abs, hghts, color="red")
ax3.plot(simple_canopy.cohort_data.f_abs, hghts, color="red")
ax3.set_xlabel("Light absorption fraction (-)")
# Plot the light extinction profile through the canopy.
ax4.plot(simple_canopy.extinction_profile, hghts, color="red")
ax4.plot(simple_canopy.community_data.extinction_profile, hghts, color="red")
ax4.set_xlabel("Cumulative light\nabsorption fraction (-)")
```

Expand Down Expand Up @@ -312,7 +312,7 @@ print(1 - np.exp(np.sum(-community.stem_traits.par_ext * cohort_lai)))
```

```{code-cell} ipython3
print(canopy.extinction_profile[-1])
print(canopy.community_data.extinction_profile[-1])
```

```{code-cell} ipython3
Expand Down Expand Up @@ -349,16 +349,16 @@ ax1.set_xlabel("Profile radius (m)")
ax1.set_ylabel("Vertical height (m)")
# Plot the leaf area between heights for stems
ax2.plot(canopy.stem_leaf_area, hghts)
ax2.plot(canopy.cohort_data.stem_leaf_area, hghts)
ax2.set_xlabel("Leaf area per stem (m2)")
# Plot the fraction of light absorbed at different heights
ax3.plot(canopy.f_abs, hghts, color="grey")
ax3.plot(1 - canopy.cohort_f_trans, hghts)
ax3.plot(canopy.cohort_data.f_abs, hghts, color="grey")
ax3.plot(1 - canopy.cohort_data.f_trans, hghts)
ax3.set_xlabel("Light absorption fraction (-)")
# Plot the light extinction profile through the canopy.
ax4.plot(canopy.extinction_profile, hghts, color="grey")
ax4.plot(canopy.community_data.extinction_profile, hghts, color="grey")
_ = ax4.set_xlabel("Cumulative light\nabsorption fraction (-)")
```

Expand Down Expand Up @@ -416,7 +416,7 @@ l_m = \left\lceil \frac{\sum_1^{N_s}{A_c}}{ A(1 - f_G)}\right\rceil
$$

```{code-cell} ipython3
canopy_ppa = Canopy(community=community, canopy_gap_fraction=2 / 32, fit_ppa=True)
canopy_ppa = Canopy(community=community, canopy_gap_fraction=0 / 32, fit_ppa=True)
```

The `canopy_ppa.heights` attribute now contains the heights at which the PPA
Expand All @@ -430,7 +430,7 @@ And the final value in the canopy extinction profile still matches the expectati
above:

```{code-cell} ipython3
print(canopy_ppa.extinction_profile[-1])
print(canopy_ppa.community_data.extinction_profile[-1])
```

### Visualizing layer closure heights and areas
Expand Down Expand Up @@ -503,18 +503,18 @@ ax1.legend(frameon=False)
for val in canopy_ppa.heights:
ax2.axhline(val, color="red", linewidth=0.5, zorder=0)
for val in canopy_ppa.extinction_profile:
for val in canopy_ppa.community_data.extinction_profile:
ax2.axvline(val, color="red", linewidth=0.5, zorder=0)
ax2.plot(canopy.extinction_profile, hghts)
ax2.plot(canopy.community_data.extinction_profile, hghts)
ax2_top = ax2.twiny()
ax2_top.set_xlim(ax2.get_xlim())
extinction_labels = [
f"$f_{{abs{l + 1}}}$ = {z:.3f}"
for l, z in enumerate(np.nditer(canopy_ppa.extinction_profile))
for l, z in enumerate(np.nditer(canopy_ppa.community_data.extinction_profile))
]
ax2_top.set_xticks(canopy_ppa.extinction_profile)
ax2_top.set_xticks(canopy_ppa.community_data.extinction_profile)
ax2_top.set_xticklabels(extinction_labels, rotation=90)
ax2.set_xlabel("Light extinction (-)")
Expand Down Expand Up @@ -548,11 +548,11 @@ The steps below show this partitioning process for the PPA layers calculated abo

```{code-cell} ipython3
print("k = \n", community.stem_traits.par_ext, "\n")
print("L_H = \n", canopy_ppa.cohort_lai)
print("L_H = \n", canopy_ppa.cohort_data.lai)
```

```{code-cell} ipython3
layer_cohort_f_tr = np.exp(-community.stem_traits.par_ext * canopy_ppa.cohort_lai)
layer_cohort_f_tr = np.exp(-community.stem_traits.par_ext * canopy_ppa.cohort_data.lai)
print(layer_cohort_f_tr)
```

Expand Down
4 changes: 0 additions & 4 deletions docs/source/users/demography/crown.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,3 @@ plt.legend(
bbox_to_anchor=(0.5, 1.15),
)
```

```{code-cell} ipython3
```

0 comments on commit d2857ce

Please sign in to comment.