helpers module
The apsg.helpers module provides utility functions used throughout APSG for
geological notation conversion and geometric calculations. It includes trigonometric
functions in degrees, converters between geological and Cartesian coordinates, and
formatting helpers.
Usage
Geological coordinate conversions:
>>> from apsg.helpers import geo2vec_planar, geo2vec_linear, vec2geo_planar, vec2geo_linear
>>> v = geo2vec_planar(120, 30) # dip direction=120, dip=30
>>> v = geo2vec_linear(210, 45) # trend=210, plunge=45
>>> strike, dip = vec2geo_planar(v)
>>> trend, plunge = vec2geo_linear(v)
Trigonometric functions in degrees:
>>> from apsg.helpers import sind, cosd, tand, asind, acosd, atand, atan2d
>>> sind(90)
1.0
>>> cosd(0)
1.0
>>> asind(1)
90.0
- apsg.helpers.sind(x)
Calculate sine of angle in degrees
- apsg.helpers.cosd(x)
Calculate cosine of angle in degrees
- apsg.helpers.tand(x)
Calculate tangent of angle in degrees
- apsg.helpers.acosd(x)
Calculate arc cosine in degrees
- apsg.helpers.asind(x)
Calculate arc sine in degrees
- apsg.helpers.atand(x)
Calculate arc tangent in degrees
- apsg.helpers.atan2d(y, x)
Calculate arc tangent in degrees in the range from pi to -pi.
- Parameters:
y (float) – y coordinate
x (float) – x coordinate
- apsg.helpers.geo2vec_planar(*args)
Function to transform geological measurement of plane to normal vector
Conversion is done according to notation configuration
- Parameters:
azi (float) – dip direction or strike
inc (float) – dip
- apsg.helpers.geo2vec_linear(*args)
Function to transform geological measurement of line to vector
- Parameters:
azi (float) – plunge direction
inc (float) – plunge