Skip to content

Commit

Permalink
Fix mode generation & variance
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchueler committed Jun 6, 2024
1 parent 456611b commit afad191
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gstools/field/generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""gene
GStools subpackage providing generators for spatial random fields.
.. currentmodule:: gstools.field.generator
Expand Down Expand Up @@ -634,7 +634,7 @@ def __init__(
modes_cutoff = self.calc_modes_cutoff(model, self._mode_rel_cutoff)
self._modes_cutoff = self._fill_to_dim(dim, modes_cutoff)
modes = [
np.arange(0.0, self._modes_cutoff[d], self._delta_k[d])
np.arange(-self._modes_cutoff[d], self._modes_cutoff[d], self._delta_k[d])
for d in range(dim)
]
elif modes is not None:
Expand Down Expand Up @@ -792,7 +792,7 @@ def reset_seed(self, seed=np.nan):
# Cython, which doesn't have access to the CovModel
k_norm = np.linalg.norm(self._modes, axis=0)
self._spectrum_factor = np.sqrt(
4.0 * self._model.spectrum(k_norm) * np.prod(self._delta_k)
self._model.spectrum(k_norm) * np.prod(self._delta_k)
)

def _fill_to_dim(
Expand Down

0 comments on commit afad191

Please sign in to comment.