Skip to content

Commit

Permalink
Change the way ani. fields are handled by Fourier
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchueler committed Jul 9, 2024
1 parent 6e709f2 commit 6084599
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gstools/field/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ def update(self, model=None, seed=np.nan, period=None, mode_no=None):
tmp_model = model if model is not None else self._model
if period is not None:
self._period = self._fill_to_dim(period, tmp_model.dim)
self._delta_k = 2.0 * np.pi / self._period
anis = np.insert(tmp_model.anis.copy(), 0, 1.0)
self._delta_k = 2. * np.pi / self._period * anis
if mode_no is None:
self._set_modes(self._mode_no, tmp_model)
if mode_no is not None:
Expand Down Expand Up @@ -791,11 +792,10 @@ def _set_modes(self, mode_no, model):
-----
`self._reset_seed` *has* to be called after this method!
"""
anis = np.insert(model.anis.copy(), 0, 1.0)
modes = [
np.arange(
-mode_no[d] / 2.0 * self._delta_k[d] / anis[d],
mode_no[d] / 2.0 * self._delta_k[d] / anis[d],
-mode_no[d] / 2.0 * self._delta_k[d],
mode_no[d] / 2.0 * self._delta_k[d],
self._delta_k[d],
)
for d in range(model.dim)
Expand Down

0 comments on commit 6084599

Please sign in to comment.