Skip to content

How do Get vector for a particularcoordiante #297

Answered by LSchueler
tkschuler asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Tristan,

that's pretty simple, you can follow the short example in the readme and simply replace the x and y vectors with single points.

import numpy as np
import gstools as gs
model = gs.Gaussian(dim=2, var=1, len_scale=10)
srf = gs.SRF(model, generator='VectorField', seed=19841203)

p1 = [0, 0]
p2 = [0, 1]

srf(p1)
srf(p2)

Calculates the random vectors at points p1 and p2.

Setting the spatial random field up is the expensive part (the part above p1 and p2), calculating the random vectors at the points is pretty fast.

I hope that helps.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MuellerSeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #296 on December 22, 2022 22:18.