Skip to content

Commit

Permalink
fix: plot vector field crashing
Browse files Browse the repository at this point in the history
model plotter vector field was using
wrong argument order for add_vector_marker
  • Loading branch information
Lachlan Grose committed Oct 14, 2021
1 parent 770e666 commit e35f6b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions LoopStructural/visualisation/model_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def add_fault_displacements(self, cmap = 'rainbow', **kwargs):

name = kwargs.get('name', 'fault_displacements')
points, tri = create_box(self.bounding_box, self.nsteps)
self._add_surface(tri, points,name, cmap=cmap) # need to pass colour somehow
self._add_surface(tri, points,name, paint_with=self.model.evaluate_fault_displacements,cmap=cmap) # need to pass colour somehow


def add_fault(self,fault,step=100):
Expand Down Expand Up @@ -599,8 +599,8 @@ def add_vector_field(self, geological_feature, **kwargs):
-------
"""
if isinstance(geological_feature,GeologicalFeature):
raise ValueError("{} is not a GeologicalFeature".format(type(geological_feature)))
# if isinstance(geological_feature,GeologicalFeature):
# raise ValueError("{} is not a GeologicalFeature".format(type(geological_feature)))
logger.info("Adding vector field for %s " % (geological_feature.name))
locations = kwargs.get('locations', None)
name = kwargs.get('name', geological_feature.name)
Expand All @@ -614,7 +614,7 @@ def add_vector_field(self, geological_feature, **kwargs):
# normalise
mask = ~np.any(np.isnan(vector), axis=1)
vector[mask, :] /= np.linalg.norm(vector[mask, :], axis=1)[:, None]
self._add_vector_marker(name, locations, vector, **kwargs)
self._add_vector_marker(locations, vector, name, **kwargs)

return

Expand Down

0 comments on commit e35f6b2

Please sign in to comment.