Skip to content

Commit

Permalink
fix: 🚑 added scale parameter for calculate_topo matrix.
Browse files Browse the repository at this point in the history
This changes the default behaviour
  • Loading branch information
Lachlan Grose committed Feb 19, 2022
1 parent 0574e57 commit 839e0e0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions LoopStructural/analysis/_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
logger = getLogger(__name__)


def calculate_fault_topology_matrix(model, xyz=None, threshold=0.001):
def calculate_fault_topology_matrix(model, xyz=None, threshold=0.001, scale=True):
"""Calculate fault ellipsoid and hw/fw
Parameters
Expand All @@ -13,12 +13,18 @@ def calculate_fault_topology_matrix(model, xyz=None, threshold=0.001):
the model containing the faults
xyz : np.array
xyz locations in model coordinates
threshold : float
threshold for determining if point is inside fault volume
scale : bool
flag whether to rescale xyz to model coordinates
Returns
-------
topology_matrix : np.array
matrix containing nan (outside), 0 (footwall), 1 (hangingwall)
"""
if xyz is not None and scale==True:
logger.warning("Scaling XYZ to model coordinate system")
xyz = model.scale(xyz,inplace=False)
if xyz is None:
xyz = model.regular_grid(rescale=False, shuffle=False)
topology_matrix = np.zeros((xyz.shape[0], len(model.faults)))
Expand Down

0 comments on commit 839e0e0

Please sign in to comment.