Skip to content

Commit

Permalink
Merge pull request #202 from GeoStat-Framework/readme_update
Browse files Browse the repository at this point in the history
Finalize v1.3.3
  • Loading branch information
MuellerSeb authored Aug 8, 2021
2 parents e96848b + 04c1bbb commit 1304059
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
All notable changes to **GSTools** will be documented in this file.


## [1.3.3] - Pure Pink - ?
## [1.3.3] - Pure Pink - 2021-08

### Enhancements
See: [#197](https://github.com/GeoStat-Framework/GSTools/issues/197)
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,19 @@ import gstools as gs
cond_pos = [0.3, 1.9, 1.1, 3.3, 4.7]
cond_val = [0.47, 0.56, 0.74, 1.47, 1.74]

gridx = np.linspace(0.0, 15.0, 151)

# conditioned spatial random field class
model = gs.Gaussian(dim=1, var=0.5, len_scale=2)
krige = gs.krige.Ordinary(model, cond_pos, cond_val)
cond_srf = gs.CondSRF(krige)
# same output positions for all ensemble members
grid_pos = np.linspace(0.0, 15.0, 151)
cond_srf.set_pos(grid_pos)

# generate the ensemble of field realizations
fields = []
# seeded ensemble generation
seed = gs.random.MasterRNG(20170519)
for i in range(100):
fields.append(cond_srf(gridx, seed=i))
plt.plot(gridx, fields[i], color="k", alpha=0.1)
field = cond_srf(seed=seed(), store=f"field_{i}")
plt.plot(grid_pos, field, color="k", alpha=0.1)
plt.scatter(cond_pos, cond_val, color="k")
plt.show()
```
Expand Down
13 changes: 7 additions & 6 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,19 @@ generate 100 realizations and plot them:
cond_pos = [0.3, 1.9, 1.1, 3.3, 4.7]
cond_val = [0.47, 0.56, 0.74, 1.47, 1.74]
gridx = np.linspace(0.0, 15.0, 151)
# conditioned spatial random field class
model = gs.Gaussian(dim=1, var=0.5, len_scale=2)
krige = gs.krige.Ordinary(model, cond_pos, cond_val)
cond_srf = gs.CondSRF(krige)
# same output positions for all ensemble members
grid_pos = np.linspace(0.0, 15.0, 151)
cond_srf.set_pos(grid_pos)
# generate the ensemble of field realizations
fields = []
# seeded ensemble generation
seed = gs.random.MasterRNG(20170519)
for i in range(100):
fields.append(cond_srf(gridx, seed=i))
plt.plot(gridx, fields[i], color="k", alpha=0.1)
field = cond_srf(seed=seed(), store=f"field_{i}")
plt.plot(grid_pos, field, color="k", alpha=0.1)
plt.scatter(cond_pos, cond_val, color="k")
plt.show()
Expand Down

0 comments on commit 1304059

Please sign in to comment.