Skip to content

How to extract a field after applying a transformation #168

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

You must be logged in to vote

Hi EnxEng!

Thanks for the feedback, very much appreciated!

Try this code:

import gstools as gs

x = y = range(100)
model = gs.Gaussian(dim=2, var=1, len_scale=10)
srf = gs.SRF(model, seed=20170519)
field = srf.structured([x, y])
srf.plot() #ok is Gaussian
print('Gaussian:')
print(field)
gs.transform.normal_to_lognormal(srf)
field_log_norm = srf.field # the transformation is saved internally
srf.plot() #ok is log normal
print('Log-Normal:')
print(field_log_norm)
field_gau_again = srf.structured([x, y])
print('Gaussian again, the srf.structured method overwrites the internally saved transformed field:')
print(field_gau_again)

Is that what you are looking for?

@MuellerSeb Is there a good rea…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MuellerSeb
Comment options

@EnxEng
Comment options

Answer selected by EnxEng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants