From 8a1c48d2e2ad83d64b8918b4d1a7c0d031f88b8d Mon Sep 17 00:00:00 2001 From: Jake Faulkner Date: Tue, 2 Jul 2024 14:55:36 +1200 Subject: [PATCH] fix dip calculation --- nshmdb/fault.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nshmdb/fault.py b/nshmdb/fault.py index 4057259..f30db2a 100644 --- a/nshmdb/fault.py +++ b/nshmdb/fault.py @@ -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 @@ -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: """ @@ -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