Skip to content

Commit

Permalink
icevol_correction() now uses benthic_stack.age copy. Closes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
brews committed May 18, 2018
1 parent b45811a commit ec4757e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 3 additions & 4 deletions erebusfall/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -45,15 +45,15 @@ 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':
sage /= 1000

# 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
Expand All @@ -73,4 +73,3 @@ def icevol_correction(age, proxyvalue, proxytype='d18o', timeunit='ya',
corrected = ((1000 + proxyvalue) / (target / 1000 + 1)) - 1000

return corrected

0 comments on commit ec4757e

Please sign in to comment.