Skip to content

Commit

Permalink
fix: call to update feature when initialising rotation angle plotter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Oct 13, 2021
1 parent 2930f36 commit b97f017
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions LoopStructural/modelling/features/geological_feature_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
from LoopStructural.utils import RegionEverywhere

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

while self.interpolator.nx < 100:
self.interpolator.support.step_vector=self.interpolator.support.step_vector*0.9

def check_interpolation_geometry(self,data):
"""Check the interpolation support geometry to data to make sure everything fits """
origin = self.interpolator.support.origin
maximum = self.interpolator.support.maximum
print(origin,maximum)
origin[origin<np.min(data,axis=0)] = np.min(data,axis=0)[origin<np.min(data,axis=0)]
maximum[maximum<np.max(data,axis=0)] = np.max(data,axis=0)[maximum<np.max(data,axis=0)]
print(origin,maximum)

self.interpolator.support.origin = origin
self.interpolator.support.maximum = maximum
def build(self, fold=None, fold_weights={}, data_region=None, **kwargs):
"""
Runs the interpolation and builds the geological feature
Expand Down
2 changes: 1 addition & 1 deletion LoopStructural/visualisation/rotation_angle_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, feature, axis=True):
self.ax[0][0].set_ylim(-90, 90)
self.ax[1][0].set_ylim(-90, 90)
self.feature = feature

self.feature.builder.up_to_date()
def plot(self, x, y, ix, iy, symb,**kwargs):
"""
Expand Down

0 comments on commit b97f017

Please sign in to comment.