Skip to content

Commit b97f017

Browse files
author
Lachlan Grose
committed
fix: call to update feature when initialising rotation angle plotter
1 parent 2930f36 commit b97f017

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

LoopStructural/modelling/features/geological_feature_builder.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
from LoopStructural.utils import RegionEverywhere
2020

2121
class GeologicalFeatureInterpolator:
22-
"""[summary]
23-
24-
[extended_summary]
25-
"""
2622
def __init__(self, interpolator, name='Feature', region=None, **kwargs):
2723
"""
2824
Constructor for a GeologicalFeatureInterpolator
@@ -199,6 +195,7 @@ def add_data_to_interpolator(self, constrained=False, force_constrained=False, *
199195
for f in self.faults:
200196
data.loc[:,xyz_names()] = f.apply_to_points(
201197
self.get_data_locations())
198+
# self.check_interpolation_geometry(data.loc[:,xyz_names()].to_numpy())
202199
# Now check whether there are enough constraints for the
203200
# interpolator to be able to solve
204201
# we need at least 2 different value points or a single norm
@@ -416,7 +413,17 @@ def set_interpolation_geometry(self,origin,maximum, rotation=None):
416413

417414
while self.interpolator.nx < 100:
418415
self.interpolator.support.step_vector=self.interpolator.support.step_vector*0.9
419-
416+
def check_interpolation_geometry(self,data):
417+
"""Check the interpolation support geometry to data to make sure everything fits """
418+
origin = self.interpolator.support.origin
419+
maximum = self.interpolator.support.maximum
420+
print(origin,maximum)
421+
origin[origin<np.min(data,axis=0)] = np.min(data,axis=0)[origin<np.min(data,axis=0)]
422+
maximum[maximum<np.max(data,axis=0)] = np.max(data,axis=0)[maximum<np.max(data,axis=0)]
423+
print(origin,maximum)
424+
425+
self.interpolator.support.origin = origin
426+
self.interpolator.support.maximum = maximum
420427
def build(self, fold=None, fold_weights={}, data_region=None, **kwargs):
421428
"""
422429
Runs the interpolation and builds the geological feature

LoopStructural/visualisation/rotation_angle_plotter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, feature, axis=True):
1616
self.ax[0][0].set_ylim(-90, 90)
1717
self.ax[1][0].set_ylim(-90, 90)
1818
self.feature = feature
19-
19+
self.feature.builder.up_to_date()
2020
def plot(self, x, y, ix, iy, symb,**kwargs):
2121
"""
2222

0 commit comments

Comments
 (0)