Skip to content

Commit

Permalink
Merge pull request #180 from GeoStat-Framework/vario_est_field_fix
Browse files Browse the repository at this point in the history
[fix] vario_estimate: prevent altering the input field
  • Loading branch information
MuellerSeb authored Jun 9, 2021
2 parents f91d3b1 + 21edb6f commit e89bf1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to **GSTools** will be documented in this file.

## [Unreleased]

### Bugfixes
- `vario_estimate` was altering the input field unter certain circumstances [#180](https://github.com/GeoStat-Framework/GSTools/issues/180)


## [1.3.1] - Pure Pink - 2021-06

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion gstools/variogram/variogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def vario_estimate(
bin_centres = (bin_edges[:-1] + bin_edges[1:]) / 2.0
# allow multiple fields at same positions (ndmin=2: first axis -> field ID)
# need to convert to ma.array, since list of ma.array is not recognised
field = np.ma.array(field, ndmin=2, dtype=np.double)
field = np.ma.array(field, ndmin=2, dtype=np.double, copy=True)
masked = np.ma.is_masked(field) or np.any(mask)
# catch special case if everything is masked
if masked and np.all(mask):
Expand Down

0 comments on commit e89bf1b

Please sign in to comment.