Generating several realizations of srf in one call. #339
-
Hello, I've been going through the documentation but I can't find a way to generate several realizations of a spatial random field in one call. Am I missing something or should I just call With a Karhunen Loeve decomposition it makes sense to do the decomposition only once in order to save some computational time. I'm not familiar with the Fourier method. Does it makes sense for that too ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In the documentation we provide a tutorial for ensemble generation of random fields: import gstools as gs
from gstools.random import MasterRNG
x = y = range(100)
model = gs.Gaussian(dim=2, var=1, len_scale=10)
srf = gs.SRF(model)
srf.set_pos([x, y], "structured")
ens_no = 4
seed = MasterRNG(20170519)
for i in range(ens_no):
srf(seed=seed(), store=f"field{i}") The randomization method is quiet efficient when it is called again with a new seed, since the sampling needed should be rather fast. Hope that helps. |
Beta Was this translation helpful? Give feedback.
In the documentation we provide a tutorial for ensemble generation of random fields:
https://geostat-framework.readthedocs.io/projects/gstools/en/v1.5.0/examples/01_random_field/01_srf_ensemble.html
The randomization method is quiet efficient when it is called again with a new seed, since the sampling needed should be rather fast.
The advantage of that method is, that it doesn't need to decompose a covariance…