Skip to main content

evodcinv

License Stars Pyversions Version Downloads Code style: black Codacy Badge Codecov Build Docs DOI

evodcinv is a Python library to invert surface wave dispersion data (e.g., phase velocity dispersion curves) for an isotropic layered velocity model using Evolutionary Algorithms. It relies on stochopy for the evolutionary optimizers while forward modeling is heavy-lifted by disba.

sample

Inversion of phase velocity dispersion curve (fundamental mode).

Features

Invertible data curves:

  • Love-wave phase and/or group velocity dispersion curves,

  • Rayleigh-wave phase and/or group velocity dispersion curves,

  • Rayleigh-wave ellipticity (experimental).

Installation

The recommended way to install evodcinv and all its dependencies is through the Python Package Index:

pip install evodcinv --user

Otherwise, clone and extract the package, then run from the package location:

pip install . --user

To test the integrity of the installed package, check out this repository and run:

pytest

Documentation

Refer to the online documentation for detailed description of the API and examples.

Alternatively, the documentation can be built using Sphinx:

pip install -r doc/requirements.txt
sphinx-build -b html doc/source doc/build

Usage

The following example inverts a Rayleigh-wave phase velocity dispersion curve (fundamental mode).

from evodcinv import EarthModel, Layer, Curve

# Initialize model
model = EarthModel()

# Build model search boundaries from top to bottom
# First argument is the bounds of layer's thickness [km]
# Second argument is the bounds of layer's S-wave velocity [km/s]
model.add(Layer([0.001, 0.1], [0.1, 3.0]))
model.add(Layer([0.001, 0.1], [0.1, 3.0]))

# Configure model
model.configure(
    optimizer="cpso",  # Evolutionary algorithm
    misfit="rmse",  # Misfit function type
    optimizer_args={
        "popsize": 10,  # Population size
        "maxiter": 100,  # Number of iterations
        "workers": -1,  # Number of cores
        "seed": 0,
    },
)

# Define the dispersion curves to invert
# period and velocity are assumed to be data arrays
curves = [Curve(period, velocity, 0, "rayleigh", "phase")]

# Run inversion
res = model.invert(curves)
print(res)

Expected output:

--------------------------------------------------------------------------------
Best model out of 501 models (1 run)

Velocity model                                    Model parameters
----------------------------------------          ------------------------------
         d        vp        vs       rho                   d        vs        nu
      [km]    [km/s]    [km/s]   [g/cm3]                [km]    [km/s]       [-]
----------------------------------------          ------------------------------
    0.0298    0.5033    0.2055    2.0000              0.0298    0.2055    0.4000
    1.0000    2.0586    0.9935    2.0000                   -    0.9935    0.3482
----------------------------------------          ------------------------------

Number of layers: 2
Number of parameters: 5
Best model misfit: 0.0038
--------------------------------------------------------------------------------

Contributing

Please refer to the Contributing Guidelines to see how you can help. This project is released with a Code of Conduct which you agree to abide by when contributing.

Metadata

Release files for evodcinv 2.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evodcinv 2.2.2
File Size Uploaded
evodcinv-2.2.2.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for evodcinv 2.2.2
File Interpreter ABI Platform
evodcinv-2.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 40.6 kB

Release files / evodcinv-2.2.2.tar.gz

Download URL evodcinv-2.2.2.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
74f0798c774f5d4e248552e2b6c36d2f9b1728a647e8ee0f613aed873289090d
BLAKE2b-256 checksum
How to use checksums
8d633136db1e88901d8c1f6606114a42844cfa0279e0d76448e9fd0bde79ac17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / evodcinv-2.2.2-py3-none-any.whl

Download URL evodcinv-2.2.2-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d3702a05d32a7b65331a685b1dafc4203089659dcccffde361a3274ee7baec4
BLAKE2b-256 checksum
How to use checksums
511556df0a7f9075dc5df3350b8519f9e4cb16ecd7a094895d3e2ea9529d92a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

2.2.2 This release

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page