# Lesson 3. Canopy Height Models, Digital Surface Models & Digital Elevation Models - Work With LiDAR Data in Python

## Learning Objectives

After completing this tutorial, you will be able to:

• Define Canopy Height Model (CHM), Digital Elevation Model (DEM) and Digital Surface Model (DSM).
• Describe the key differences between the CHM, DEM, DSM.

As you learned in the previous lesson, LiDAR or Light Detection and Ranging is an active remote sensing system that can be used to measure vegetation height across wide areas.

If the data are discrete return, Lidar point clouds are most commonly derived data product from a lidar system. However, often people work with lidar data in raster format given it’s smaller in size and thus easier to work with. In this lesson, you will import and work with 3 of the most common lidar derived data products in Python:

1. Digital Terrain Model (or DTM): ground elevation.
2. Digital Surface Model (or DSM): top of the surface (imagine draping a sheet over the canopy of a forest
3. Canopy Height Model (CHM): the elevation of the Earth’s surface - and it sometimes also called a DEM or digital elevation model.

## 3 Important Lidar Data Products: CHM, DEM, DSM

### Digital Elevation Model

In the previous lesson, you opened and explored a digital elevation model (DEM). The DEM, also known as a digital terrain model (DTM) represents the elevation of the earth’s surface. The DEM represents the ground - and thus DOES NOT INCLUDE trees and buildings and other objects.

In this lesson, you will explore Digital Surface Models (DSM) and will use the DEM and the DSM to create a canopy height model (CHM).

# open raster data
bounds = lidar_dem.bounds

# Reshape the bounds into a form that matplotlib wants
bounds = [bounds.left, bounds.right, bounds.bottom, bounds.top]

fig, ax = plt.subplots(figsize=(10, 10))
fin_plot = ax.imshow(lidar_dem_im[0], cmap='viridis')
ax.set_axis_off()

# scale color bar to the height of the plot
divider = make_axes_locatable(ax)
fig.colorbar(fin_plot, cax = cax)
ax.set_title("Lidar Digital Elevation Model (DEM)",
fontsize = 16);


### Import digital surface model (DSM)

Next, let’s open the digital surface model (DSM). The DSM represents the top of the earth’s surface. Thus, it INCLUDES TREES, BUILDINGS and other objects that sit on the earth.

### Canopy Height Model

The canopy height model (CHM) represents the HEIGHT of the trees. This is not an elevation value, rather it’s the height or distance between the ground and the top of the trees (or buildings or whatever object that the lidar system detected and recorded).

Some canopy height models also include buildings, so you need to look closely at your data to make sure it was properly cleaned before assuming it represents all trees!

#### Calculate difference between two rasters

There are different ways to calculate a CHM. One easy way is to subtract the DEM from the DSM.

DSM - DEM = CHM

You will learn how to subtract rasters in the subtract raster lesson.