Skip to content

Commit

Permalink
[BUG]Small bug on magnetics
Browse files Browse the repository at this point in the history
  • Loading branch information
Leguark committed Oct 10, 2023
1 parent 540b39d commit 86c9b4d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gempy_legacy/core/interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,13 +587,15 @@ def set_aesara_shared_gravity(self, tz='auto', pos_density=1):
class InterpolatorMagnetics:
def set_aesara_shared_Vs_kernel(self, V=None):

if V is None or V == 'auto':
# Check that V is not None an is not auto consider that V is can be numpy array
if V is not None and np.any(V != 'auto'):
self.aesara_graph.V.set_value(V.astype(self.dtype))
else:
try:
V = self.calculate_V(self.grid.centered_grid)
except AttributeError:
raise AttributeError('You need to calculate or pass V first.')

self.aesara_graph.V.set_value(V.astype(self.dtype))

def calculate_V(self, centered_grid):
from gempy_legacy.assets.geophysics import MagneticsPreprocessing
Expand Down

0 comments on commit 86c9b4d

Please sign in to comment.