Skip to content

Commit

Permalink
krige: apply trend_function instantly when set
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb authored and LSchueler committed Jul 17, 2020
1 parent 48208f3 commit 67861b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gstools/krige/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,12 @@ def trend_function(self, trend_function):
if not callable(trend_function):
raise ValueError("Detrended kriging: trend function not callable.")
self._trend_function = trend_function
# apply trend_function instantly (if cond_pos already set)
if self._cond_pos is not None:
if self._trend_function is no_trend:
self._cond_trend = 0.0
else:
self._cond_trend = self._trend_function(*self.cond_pos)

@property
def name(self):
Expand Down

0 comments on commit 67861b8

Please sign in to comment.