diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b5b7f6c..d440cf1f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/gstools/variogram/variogram.py b/gstools/variogram/variogram.py index f979e61c..c6d98e9f 100644 --- a/gstools/variogram/variogram.py +++ b/gstools/variogram/variogram.py @@ -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):