Earthquake Intensity Map

Earthquake Intensity Map#

Measuring the impact felt by an earthquake in Morocco is the foundation to analysing the damage incurred in Morocco. This section shows maps of Earthquake Intensity felt in different parts of the country.

Data#

Earthquake Intensity Data was obtained from USGS and was overlayed with shapefiles of Morocco admin regions taken from UNOCHA and from GADM[https://gadm.org/download_country.html]. This can be used as a baseline map upon which other indicators can be visualized. The MMI is a range that allows us to estimate the amount of damage done to buildings.

Methodology#

The impact of the earthquake in this situation is measured using the Modified Mercalli Intensity Scale (mmi).

The effect of an earthquake on the Earth’s surface is called the intensity. The intensity scale consists of a series of certain key responses such as people awakening, movement of furniture, damage to chimneys, and finally - total destruction. Although numerousintensity scales have been developed over the last several hundred years to evaluate the effects of earthquakes, the one currently used in the United States is the Modified Mercalli (MM) Intensity Scale. It was developed in 1931 by the American seismologists Harry Wood and Frank Neumann. This scale, composed of increasing levels of intensity that range from imperceptible shaking to catastrophic destruction, is designated by Roman numerals. It does not have a mathematical basis; instead it is an arbitrary ranking based on observed effects.

The Modified Mercalli Intensity value assigned to a specific site after an earthquake has a more meaningful measure of severity to the nonscientist than the magnitude because intensity refers to the effects actually experienced at that place.

The lower numbers of the intensity scale generally deal with the manner in which the earthquake is felt by people. The higher numbers of the scale are based on observed structural damage. Structural engineers usually contribute information for assigning intensity values of VIII or above.

Source: USGS Modified Mercalli Intensity Scale

Alternatively, another variable that can be used is also the distance from the epicenter.

image.png

Results#

Hide code cell source
fig, ax = plt.subplots(figsize=(12,6))
plt.rcParams["font.family"] = "Georgia"

gdf=gdf_adm4

vmin = gdf['PARAMVALUE'].min()
vmax = gdf['PARAMVALUE'].max()



morocco_adm4.boundary.plot(ax=ax, color='#f2f2f2', alpha=0.8, linewidth=0.5)
affected_regions.plot(column='PARAMVALUE', cmap ='Reds', ax=ax, vmax=vmax, legend = True)


ax.spines['top'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)

ax.set_xticks([])
ax.set_yticks([])

text_to_add = gdf_adm4[gdf_adm4['PARAMVALUE']== gdf_adm4['PARAMVALUE'].max()]['NAME_4'].iloc[0]
x, y =gdf_adm4[gdf_adm4['PARAMVALUE']== gdf_adm4['PARAMVALUE'].max()]['geometry'].iloc[0].centroid.x, gdf_adm4[gdf_adm4['PARAMVALUE']== gdf_adm4['PARAMVALUE'].max()]['geometry'].iloc[0].centroid.y

ax.scatter(x, y, c='black', marker='o', s=50, label=text_to_add)
# Use the annotate function to add the text to the map
ax.annotate(text_to_add, xy=(x-0.5, y-0.5), xytext=(10, 10), textcoords='offset points',
            fontsize=10, color='black')

text_to_add = gdf_adm4[gdf_adm4['NAME_4']== 'Marrakech Medina']['NAME_4'].iloc[0]
x, y =gdf_adm4[gdf_adm4['NAME_4']== 'Marrakech Medina']['geometry'].iloc[0].centroid.x, gdf_adm4[gdf_adm4['NAME_4']== 'Marrakech Medina']['geometry'].iloc[0].centroid.y

ax.scatter(x, y, c='black', marker='o', s=50, label=text_to_add)

# Use the annotate function to add the text to the map
ax.annotate(text_to_add, xy=(x-0.05, y-0.3), xytext=(10, 10), textcoords='offset points',
            fontsize=10, color='black', weight='bold')


# sm = plt.cm.ScalarMappable(cmap='viridis',norm=plt.Normalize(vmin=vmin, vmax=vmax))


# divider = make_axes_locatable(ax)
# dvider_kwargs = dict(position="left", size="1.5%", pad=0)
# fig.colorbar(sm, cax=divider.append_axes(**dvider_kwargs),
#              #format = matplotlib.ticker.FuncFormatter(lambda x, pos: ''),
#              #ticks = matplotlib.ticker.FixedLocator([])
#              )

plt.title('Earthquake intensity by admin 4')

subtitle = f'Source: Earthquake intensity (Modified Mercalli Intensity) from USGS.\n Shapefiles from GADM'

ax.text(0, 0, subtitle, ha='left', va='center', transform=ax.transAxes,
        fontsize=10, color='gray', weight='normal')

# # Create a custom legend
# legend_labels = ['Low Damage', 'High Damage', 'Very High Damage']
# legend_colors = ['grey', 'orange', 'red']

# # Create custom legend handles
# from matplotlib.lines import Line2D
# legend_handles = [Line2D([0], [0], marker='o', color='w', label=legend_labels[i], markersize=10, markerfacecolor=legend_colors[i]) for i in range(len(legend_labels))]

# # Display the custom legend
# plt.legend(handles=legend_handles, loc='center left', bbox_to_anchor=(1, 0.5), frameon=False)

plt.savefig('../../docs/images/01_earthquake_intensity_adm4.png')
../../_images/efb7ccd1d9a7ade196557313e191a9b7f1a8b299719aed313f8f14e870ce0a8a.png
Hide code cell source
fig, ax = plt.subplots(figsize=(12,6))
plt.rcParams["font.family"] = "Georgia"

gdf=gdf_adm3

vmin = gdf['PARAMVALUE'].min()
vmax = gdf['PARAMVALUE'].max()

gdf.plot(column='mmi_class', color = gdf['mmi_color'], ax=ax, vmax=vmax, legend = True)

ax.spines['top'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)

ax.set_xticks([])
ax.set_yticks([])


# sm = plt.cm.ScalarMappable(cmap='viridis',norm=plt.Normalize(vmin=vmin, vmax=vmax))

text_to_add = gdf_adm3[gdf_adm3['PARAMVALUE']== gdf_adm3['PARAMVALUE'].max()]['NAME_3'].iloc[0]
x, y =gdf_adm3[gdf_adm3['PARAMVALUE']== gdf_adm3['PARAMVALUE'].max()]['geometry'].iloc[0].centroid.x, gdf_adm3[gdf_adm3['PARAMVALUE']== gdf_adm3['PARAMVALUE'].max()]['geometry'].iloc[0].centroid.y

ax.scatter(x, y, c='black', marker='o', s=50, label=text_to_add)
# Use the annotate function to add the text to the map
ax.annotate(text_to_add, xy=(x-0.5, y-0.5), xytext=(10, 10), textcoords='offset points',
            fontsize=10, color='white')

text_to_add = gdf_adm3[gdf_adm3['NAME_3']== 'NA (Marrakech Medina)']['NAME_3'].iloc[0]
x, y =gdf_adm3[gdf_adm3['NAME_3']== 'NA (Marrakech Medina)']['geometry'].iloc[0].centroid.x, gdf_adm3[gdf_adm3['NAME_3']== 'NA (Marrakech Medina)']['geometry'].iloc[0].centroid.y

ax.scatter(x, y, c='black', marker='o', s=50, label='Marrakech Medina')

# Use the annotate function to add the text to the map
ax.annotate('Marrakech Medina', xy=(x-0.05, y-0.3), xytext=(10, 10), textcoords='offset points',
            fontsize=10, color='white', weight='bold')


# divider = make_axes_locatable(ax)
# dvider_kwargs = dict(position="left", size="1.5%", pad=0)
# fig.colorbar(sm, cax=divider.append_axes(**dvider_kwargs),
#              #format = matplotlib.ticker.FuncFormatter(lambda x, pos: ''),
#              #ticks = matplotlib.ticker.FixedLocator([])
#              )

plt.title('Earthquake intensity by admin 3')

subtitle = f'Source: Earthquake intensity (Modified Mercalli Intensity) from USGS.\n Shapefiles from GADM'

ax.text(0, 0, subtitle, ha='left', va='center', transform=ax.transAxes,
        fontsize=10, color='gray', weight='normal')

# Create a custom legend
legend_labels = ['Low Damage', 'High Damage', 'Very High Damage']
legend_colors = ['grey', 'orange', 'red']

# Create custom legend handles
from matplotlib.lines import Line2D
legend_handles = [Line2D([0], [0], marker='o', color='w', label=legend_labels[i], markersize=10, markerfacecolor=legend_colors[i]) for i in range(len(legend_labels))]

# Display the custom legend
plt.legend(handles=legend_handles, loc='center left', bbox_to_anchor=(1, 0.5), frameon=False)


plt.savefig('../../docs/images/01_earthquake_intensity_adm3.png')
../../_images/373e48de0d47f7d5903fdfc93174c807cb9be0631a1a85f9deb4c8f9cbfe6b83.png