Skip to content

Commit

Permalink
fix dip calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
lispandfound committed Jul 2, 2024
1 parent 4b3106b commit 8a1c48d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nshmdb/fault.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

import dataclasses
from enum import Enum
from typing import Optional

import numpy as np
from typing import Optional
from qcore import coordinates, geo


Expand Down Expand Up @@ -110,6 +110,10 @@ def bottom_m(self) -> float:
"""
return self.corners_nztm[-1, -1]

@property
def top_m(self) -> float:
return self.corners_nztm[0, -1]

@property
def width(self) -> float:
"""
Expand Down Expand Up @@ -193,7 +197,7 @@ def dip(self) -> float:
float
The dip angle of the fault.
"""
return np.degrees(np.arcsin(np.abs(self.bottom_m) / self.width_m))
return np.degrees(np.arcsin(np.abs(self.bottom_m - self.top_m) / self.width_m))

def plane_coordinates_to_global_coordinates(
self, plane_coordinates: np.ndarray
Expand Down

0 comments on commit 8a1c48d

Please sign in to comment.