Skip to content

Commit

Permalink
fix: end of day fold frame
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Sep 15, 2021
1 parent 7d12b3b commit 6c49981
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
8 changes: 5 additions & 3 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,15 +773,17 @@ def create_and_add_fold_frame(self, foldframe_data, tol=None,**kwargs):
#
fold_frame_builder = StructuralFrameBuilder(interpolator,
name=foldframe_data,
frame=FoldFrame,
**kwargs)
# add data
fold_frame_data = self.data[self.data['feature_name'] == foldframe_data]
fold_frame_builder.add_data_from_data_frame(fold_frame_data)
self._add_faults(fold_frame_builder[0])
self._add_faults(fold_frame_builder[1])
self._add_faults(fold_frame_builder[2])

fold_frame = fold_frame_builder.build(frame=FoldFrame, tol=tol, **kwargs)
kwargs['tol'] = tol
fold_frame_builder.build_arguments = kwargs
fold_frame = fold_frame_builder.frame
# for i in range(3):
# self._add_unconformity_above(fold_frame[i])
fold_frame.type = 'structuralframe'
Expand Down Expand Up @@ -900,7 +902,7 @@ def create_and_add_folded_fold_frame(self, fold_frame_data,
kwargs['frame'] = FoldFrame
kwargs['tol'] = tol
fold_frame_builder.build_arguments = kwargs
folded_fold_frame = fold_frame_builder.feature
folded_fold_frame = fold_frame_builder.frame

folded_fold_frame.type = 'structuralframe'
# see if any unconformities are above this feature if so add region
Expand Down
11 changes: 7 additions & 4 deletions LoopStructural/modelling/features/structural_frame_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class StructuralFrameBuilder:
[extended_summary]
"""
def __init__(self, interpolator=None, interpolators=None, **kwargs):
def __init__(self, interpolator=None, interpolators=None, frame=StructuralFrame,**kwargs):
"""
Class for building a structural frame - has functions to set up the
interpolator with
Expand Down Expand Up @@ -73,10 +73,13 @@ def __init__(self, interpolator=None, interpolators=None, **kwargs):
GeologicalFeatureInterpolator(interpolators[2],
name=self.name + '_2',
**kwargs)) # ,region=self.region))

self._frame = frame(self.name, [gx_feature, gy_feature, gz_feature],fold=fold)

self._frame = frame(self.name, [self.builders[0].feature,
self.builders[1].feature,
self.builders[2].feature],fold=kwargs.get('fold',None))
@property

def frame(self):
return self._frame

def __getitem__(self, item):
return self.builders[item]
Expand Down
5 changes: 5 additions & 0 deletions LoopStructural/modelling/fold/fold_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ def build(self, data_region=None, **kwargs):
# gradient not norm, to prevent issues with fold norm constraint
# TODO folding norm constraint should be minimising the difference in norm
# not setting the norm
print('fold builder build')
print(self.data)
self.add_data_to_interpolator(constrained=True)
print(self.interpolator.get_gradient_constraints())
print(self.interpolator.get_norm_constraints())

self.set_fold_axis()
self.set_fold_limb_rotation()
logger.info("Adding fold to {}".format(self.name))
Expand Down
1 change: 1 addition & 0 deletions LoopStructural/modelling/fold/svariogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def calc_semivariogram(self, lag = None, nlag = None, lags = None):
# find number of steps to cover range in data
nstep = int(
np.ceil((np.nanmax(self.xdata) - np.nanmin(self.xdata)) / step))
print(nstep,step)
self.lags = np.arange(step / 2., nstep * step, step)
logger.info("Using average minimum nearest neighbour distance "
"as lag distance size {} and using {} lags".format(step,nstep))
Expand Down

0 comments on commit 6c49981

Please sign in to comment.