Skip to main content

Efficient implementatins of the Konno Ohmachi filter in Python.

Project description

pykooh

PyPi Cheese Shop Build Status Code Quality Test Coverage License DOI

Konno Ohmachi filter implemented in Numba.

This code implements Konno-Ohmachi spectral smoothing as defined in:

Konno, K. and Ohmachi, T., 1998. Ground-motion characteristics estimated
from spectral ratio between horizontal and vertical components of
microtremor. Bulletin of the Seismological Society of America, 88(1),
pp.228-241.

This code was originally written for smoothing sub-module in gmprocess by Bruce Worden. Dave Boore has provided notes on this topic, which also may be of interest. Notes regarding the characteristics of the Konno-Ohmachi filter and the implementation are provided in the implementation Jupyter Notebook.

Installation

pykooh is available via pip and can be installed with:

pip install pykooh

By default, pykooh uses numba for the fast implementation of the filter. Performance can be increased by using cython, but this requires a C complier. If a C compiler is available, install cython required dependencies with:

pip install pykooh[cython]

Usage

Smooth a signal using a bandwith of 30.

import pykooh
signal_smooth = pykooh.smooth(freqs, freqs_raw, signal_raw, 30)

Additional examples and comparison with obspy are provided in example.

Citation

Please cite this software using the following DOI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykooh-0.4.0.tar.gz (412.6 kB view hashes)

Uploaded Source

Built Distributions

pykooh-0.4.0-cp312-cp312-manylinux_2_35_x86_64.whl (6.7 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.35+ x86-64

pykooh-0.4.0-cp311-cp311-manylinux_2_39_x86_64.whl (6.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.39+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page