From ec4757e501a1cfde2ffe021ebaf7303633887618 Mon Sep 17 00:00:00 2001 From: Brewster Malevich Date: Thu, 17 May 2018 20:21:35 -0700 Subject: [PATCH] icevol_correction() now uses benthic_stack.age copy. Closes #2. --- NEWS.md | 2 +- erebusfall/core.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 716a9d7..ee77e23 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # erebusfall v0.0.2 -* +* Fix bug that can cause bad corrections when multiple cores are run (issue #2). # erebusfall v0.0.1 diff --git a/erebusfall/core.py b/erebusfall/core.py index 9a2136f..434d1bc 100644 --- a/erebusfall/core.py +++ b/erebusfall/core.py @@ -4,7 +4,7 @@ def icevol_correction(age, proxyvalue, proxytype='d18o', timeunit='ya', - benthic_stack=None): + benthic_stack=None): """Correct isotopic proxy data for ice-volume contribution This function uses the LR04 benthic stack scaled such that the LGM-present @@ -45,7 +45,7 @@ def icevol_correction(age, proxyvalue, proxytype='d18o', timeunit='ya', if benthic_stack is None: benthic_stack = stacks.lr04 - sage = benthic_stack.age + sage = benthic_stack.age.copy() if timeunit == 'ya': sage *= 1000 elif timeunit == 'ma': @@ -53,7 +53,7 @@ def icevol_correction(age, proxyvalue, proxytype='d18o', timeunit='ya', # Linearly interpolate the scaled benthic stack to the target data ages. interp_f = interp1d(sage, benthic_stack.delo_scaled, kind='linear', - bounds_error=False) + bounds_error=False) target = interp_f(age) # Find any ages that are negative (e.g., post-1950) and turn to 0 @@ -73,4 +73,3 @@ def icevol_correction(age, proxyvalue, proxytype='d18o', timeunit='ya', corrected = ((1000 + proxyvalue) / (target / 1000 + 1)) - 1000 return corrected - \ No newline at end of file