STRUCTURAL GEOLOGY: An Introduction to Geometrical Techniques
Post type
Discipline
Participation type
Node type
Node
Code
Geology
Instantiating
Equation
Equation 2.2
Language
Version
Python
3.0
# This code was written in Python 3
# The code calculates the thickness of a layer outcropped on the surface,
# where it is not possible to make measurements in the strike-normal direction.
# Equation 2.2 in Ragan (2009): t = l sin β sin δ
# l: The oblique traverse length on the layer outcropped
# b: The strucutral bearing of the traverse (in degrees)
# d: Dip angle of the layer (in degrees)
# Sample of arrays of input data:
# l = [1, 1, 1, 1]
# b = [90, 60, 30, 0]
# d = [0, 30, 60, 90]
# Importing the module math
import math
# Importing the numpy package
import numpy as np
# The function thickness calculates the true thickness of the layer
def thickness(l, b, d):
return l * math.sin(math.radians(b)) * math.sin(math.radians(d))
# The following three lines request users to enter w and d as arrays
l = input('Enter l values as an array: ')
b = input('Enter b values as an array: ')
d = input('Enter d values as an array: ')
# The following three lines convert input values to array
l = np.array(eval(l))
d = np.array(eval(d))
b = np.array(eval(b))
# Iterating the function thickness for each value of input data
for i in range(0, len(l), 1):
print(thickness(l[i], b[i], d[i]))