You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
990 B

# - GPLv3
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from . import autopick_ext
import numpy as num
8 years ago
class AutopickError(Exception):
8 years ago
def recursive_stalta(
tshort, tlong, kshort, klong, kderivative, energytrace,
temp=None, inplace=True):
if not energytrace.ydata.dtype == num.float32:
8 years ago
raise AutopickError(
'energytrace given to recursive_stalta() must have data in '
'float32 format.')
ns = int(round(tshort/energytrace.deltat))
nl = int(round(tlong/energytrace.deltat))
8 years ago
if temp is None:
temp = num.zeros((ns+2,), dtype=num.float32)
8 years ago
if not inplace:
energytrace = energytrace.copy()
8 years ago
ns, nl, kshort/ns, klong/nl, kderivative, energytrace.ydata,
temp, temp is None)
if inplace:
return temp
return energytrace, temp