Skip to content

Commit

Permalink
fix: splot not working for overturned folds
Browse files Browse the repository at this point in the history
rotation angles need to be flipped when the fold axis and the x product
between two vectors are not pointing in the same dir
  • Loading branch information
Lachlan Grose committed Dec 2, 2021
1 parent 31e1afb commit 2e185b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
16 changes: 4 additions & 12 deletions LoopStructural/interpolators/discrete_fold_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ def add_fold_constraints(
np.random.shuffle(element_idx)

logger.info(
"Adding fold orientation constraint to %s w = %f"
% (self.propertyname, fold_orientation)
f"Adding fold orientation constraint to {self.propertyname} w = {fold_orientation}"
)
A = np.einsum(
"ij,ijk->ik",
Expand All @@ -164,8 +163,7 @@ def add_fold_constraints(
np.random.shuffle(element_idx)

logger.info(
"Adding fold axis constraint to %s w = %f"
% (self.propertyname, fold_axis_w)
f"Adding fold axis constraint to {self.propertyname} w = {fold_axis_w}"
)
A = np.einsum(
"ij,ijk->ik",
Expand All @@ -187,8 +185,7 @@ def add_fold_constraints(
np.random.shuffle(element_idx)

logger.info(
"Adding fold normalisation constraint to %s w = %f"
% (self.propertyname, fold_normalisation)
f"Adding fold normalisation constraint to {self.propertyname} w = {fold_normalisation}"
)
A = np.einsum(
"ij,ijk->ik", dgz[element_idx[::step], :], eg[element_idx[::step], :, :]
Expand All @@ -212,12 +209,7 @@ def add_fold_constraints(
fold constant gradient
"""
logger.info(
"Adding fold regularisation constraint to {} w = {} {} {}".format(
self.propertyname,
fold_regularisation[0],
fold_regularisation[1],
fold_regularisation[1],
)
f"Adding fold regularisation constraint to {self.propertyname} w = {fold_regularisation[0]} {fold_regularisation[1]} {fold_regularisation[2]}"
)

idc, c, ncons = fold_cg(
Expand Down
6 changes: 4 additions & 2 deletions LoopStructural/modelling/fold/foldframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ def calculate_fold_limb_rotation(self, feature_builder, axis=None):
ds = np.einsum("ij,ij->i", fold_axis, vv)
flr = np.rad2deg(
np.arcsin(r2)
) # np.where(np.abs(ds) < 0.5, np.rad2deg(np.arcsin(r2)),
# (- np.rad2deg(np.arcsin(r2))))
) # np.where(ds > 0, np.rad2deg(np.arcsin(r2)),
# (- )))
flr[ds < 0] *= -1

# flr = np.where(flr < -90, (180. + flr), flr)
# flr = np.where(flr > 90, -(180. - flr), flr)
return flr, s1
Expand Down

0 comments on commit 2e185b5

Please sign in to comment.