-
Notifications
You must be signed in to change notification settings - Fork 80
Variogram estimation from multiple fields #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f672536
vario unstruct: allow multiple fields to estimate variogram
MuellerSeb 1d61fd2
test: test multi field variogram estimation
MuellerSeb 0272f70
examples: add example for multi-field variogram estimation
MuellerSeb e9763f5
vario: fix sampling of multi fields
MuellerSeb fb1b416
vario: fix sampling
MuellerSeb 67b9b0b
vario: fix multi field est test
MuellerSeb fe00f6a
vario unstr: check shape of field value
MuellerSeb 14ac780
vario: skipping no_data values fixed
MuellerSeb 7e06835
test: test no_data values in vario est
MuellerSeb 0217040
examples: polish multi vario example
MuellerSeb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| """ | ||
| Multi-field variogram estimation | ||
| -------------------------------- | ||
|
|
||
| In this example, we demonstrate how to estimate a variogram from multiple | ||
| fields at the same point-set, that should have the same statistical properties. | ||
| """ | ||
| import numpy as np | ||
| import gstools as gs | ||
| import matplotlib.pyplot as plt | ||
|
|
||
|
|
||
| x = np.random.RandomState(19970221).rand(1000) * 100.0 | ||
| y = np.random.RandomState(20011012).rand(1000) * 100.0 | ||
| model = gs.Exponential(dim=2, var=2, len_scale=8) | ||
| srf = gs.SRF(model, mean=0) | ||
|
|
||
| ############################################################################### | ||
| # Generate two synthetic fields with an exponential model. | ||
|
|
||
| field1 = srf((x, y), seed=19970221) | ||
| field2 = srf((x, y), seed=20011012) | ||
| fields = [field1, field2] | ||
|
|
||
| ############################################################################### | ||
| # Now we estimate the variograms for both fields individual and then again | ||
| # simultaneously with only one call. | ||
|
|
||
| bins = np.arange(40) | ||
| bin_center, gamma1 = gs.vario_estimate_unstructured((x, y), field1, bins) | ||
| bin_center, gamma2 = gs.vario_estimate_unstructured((x, y), field2, bins) | ||
| bin_center, gamma = gs.vario_estimate_unstructured((x, y), fields, bins) | ||
|
|
||
| ############################################################################### | ||
| # Now we demonstrate, that the mean variogram from both fields coincides | ||
| # with the joined estimated one. | ||
|
|
||
| plt.plot(bin_center, gamma1, label="field 1") | ||
| plt.plot(bin_center, gamma2, label="field 2") | ||
| plt.plot(bin_center, gamma, label="field joint") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "field joint" => "joined fields" ? |
||
| plt.plot(bin_center, 0.5 * (gamma1 + gamma2), ":", label="field 1+2 mean") | ||
| plt.legend() | ||
| plt.show() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
individual => individually