see code…
"""
Strain model used in Gilgannon et al. (2023)
Script documents an example of the transformation of linear objects in a strain
feild. Equations used come from section 4-5 in Ramsay (1967).
AUTHOR
James Gilgannon
email: jamesgilgannon@hotmail.com
REVISION
1 (2023-02-22)
REFERENCES
[1] Ramsay, J.G. (1967). Folding and fracturing of rock
"""
import numpy as np
import matplotlib.pyplot as plt
import mplstereonet
# Number of measurements
number_of_points = 18
number_of_plunges = 5
### Generate set lines with uniform distriubtion -------------------------------
trends_1_deg = np.linspace(-180, 180,number_of_points)
plunges_1_deg = np.linspace(0, 90, number_of_plunges)
# Apply transformation to make plunges uniform
plunges_1_deg_unif = np.cos(plunges_1_deg)
plunges_1_deg = np.rad2deg(plunges_1_deg_unif)
# Recast data across a grid
xx, yy = np.meshgrid(trends_1_deg, plunges_1_deg)
trends_1_deg = [item for sublist in xx for item in sublist]
plunges_1_deg = [item for sublist in yy for item in sublist]
# convert to radians
trends_1_rad = np.deg2rad(trends_1_deg)
plunges_1_rad =np.deg2rad(plunges_1_deg)
### Calculate directional cosines ----------------------------------------------
# Convestion for axis association: l = x, m = y, n = z
l = np.sin(trends_1_rad)*np.cos(plunges_1_rad)
m = np.cos(trends_1_rad)*np.cos(plunges_1_rad)
n = -np.sin(plunges_1_rad)
### Defines strain feild -------------------------------------------------------
e_x = 0
e_y = 0
e_z = -0.8
### Calculate principle quadratic elongations ----------------------------------
lambda_1 = (1+e_x)**2
lambda_2 = (1+e_y)**2
lambda_3 = (1+e_z)**2
### Preform deformation and rotation of lines ----------------------------------
sum_directional_cosines_quad_strain = (lambda_1*(l**2)) + (lambda_2*(m**2)) + (lambda_3*(n**2))
l_prime_2 = (lambda_1*(l**2))/sum_directional_cosines_quad_strain
m_prime_2 = (lambda_2*(m**2))/sum_directional_cosines_quad_strain
n_prime_2 = (lambda_3*(n**2))/sum_directional_cosines_quad_strain
# New deformed directional cosines
l_prime = np.sqrt(l_prime_2)
m_prime = np.sqrt(m_prime_2)
n_prime = np.sqrt(n_prime_2)
# Ensure correct directionaility because deformation operation makes all cosines +ve
# and collapses the lines into one quadrant
for i, l_value in enumerate(l):
if l[i] < 0:
l_prime[i] = -l_prime[i]
for i, m_value in enumerate(m):
if m[i] < 0:
m_prime[i] = -m_prime[i]
for i, n_value in enumerate(n):
if n[i] < 0:
n_prime[i] = -n_prime[i]
# Convert back to plunge and trend but enusre that trend azi are respected by adding 180
# where appropriate ---------------------------------------------------------------------------
trends_new = []
for i, val in enumerate(m_prime):
if m_prime[i] <0:
trend = np.arctan(l_prime[i]/m_prime[i]) + np.pi
trends_new.append(trend)
else:
trend = np.arctan(l_prime[i]/m_prime[i])
trends_new.append(trend)
plunges_new = -np.arcsin(n_prime)
# Convert to degrees
plunges_new_deg = np.rad2deg(plunges_new)
trends_new_deg = np.rad2deg(trends_new)
# Convert to circular angles appropriate for azimuth
trends_new_deg = [i % 360 for i in trends_new_deg]
### Plotting -------------------------------------------------------------------
# Pole figure params
sigma=5
vmax =5
vmin =0
levels = 5
cmap = 'Greys'
fig = plt.figure()
ax = fig.add_subplot(221, projection='stereonet')
ax.line(plunges_1_deg,trends_1_deg)
ax.set_azimuth_ticks([0,270])
ax.set_azimuth_ticklabels(['X','Y'])
ax = fig.add_subplot(222, projection='stereonet')
ax.line(plunges_new_deg,trends_new_deg)
ax.set_azimuth_ticks([0,270])
ax.set_azimuth_ticklabels(['',''])
ax = fig.add_subplot(223, projection='stereonet')
u = ax.density_contourf(plunges_1_deg,trends_1_deg,
measurement='lines', cmap =cmap,
method='exponential_kamb',
sigma=sigma,
vmax =vmax,
levels = levels
)
ax.set_azimuth_ticks([0,270])
ax.set_azimuth_ticklabels(['',''])
plt.colorbar(u,ax=ax)
ax = fig.add_subplot(224, projection='stereonet')
u = ax.density_contourf(plunges_new_deg,trends_new_deg,
measurement='lines', cmap =cmap,
method='exponential_kamb',
sigma=sigma,
vmax =vmax,
levels = levels
)
ax.set_azimuth_ticks([0,270])
ax.set_azimuth_ticklabels(['',''])
plt.colorbar(u,ax=ax)
plt.show()