Skip to main content

SWavePy - Seismic Wave Propagation Simulation

Usage

Installing with pip

pip install swavepy

Original tutorial taken from Nienke Blom, see this link. Updated by Deborah Wehner for use in Cambridge practicals, and updated again here to ensure animated plots work properly, and compiled into a pip-installable module.

Changes made:

  • Plotting code rewritten - ensuring that animated plots work properly in updated binder environments
  • Small changes to instructions to reflect this
  • Branch version which turns the repo into a pip package, for use on colab

Basic seismic wave propagation code for teaching purposes (python based). With this code, you can:

  • run elastic seismic wavefield simulations
  • select data windows
  • compute sensitivity kernels

Visualisation functionality

At each stage, visualisation functionality is included.

Visualising seismograms

If (after a forward simulation) a seismogram has been attached to a receiver, this can be visualised with:

rec.plot_seismogram()

Visualising window picks

Equally, window picks (and the resulting adjoint sources) can be visualised with

pick = {}
pick['component'] = ['x']   # 'x' or 'z'
pick['times'] = [3.5, 7.5]  # seconds
print('window goes from {} to {} s'.format(pick['times'][0], pick['times'][1]))

receivers_Pwave = waveprop.make_adjoint_source(receivers, pick, plot=3)

Visualising sensitivity kernels

Once sensitivity kernels have been computed, these can be visualised in different parametrisations and as absolute, or relative to a background model. For simple direct waves, it can be instructive to compare the sensitivity kernel to the Fresnel zone. This Fresnel zone can be visualised by setting plot_Fresnel_zone to True.

kernels..plot_kernels(
    parametrisation='rhovsvp' # could be 'rhomulambda'
    mode='relative',          # could be 'absolute'
    model=model,              # necessary for all kernels other than absolute rhomulambda
    source=src, receiver=receivers[0], 
    plot_Fresnel_zone=True,
)

Metadata

Release files for swavepy 0.0.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 swavepy 0.0.2
File Size Uploaded Provenance Actions
swavepy-0.0.2.tar.gz 53.8 kB Without provenance Details for swavepy-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 97.1 kB

Release files / swavepy-0.0.2.tar.gz

Download URL swavepy-0.0.2.tar.gz
Size 53.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1a25ed4e27716091080f896eae6b61b2c20c3e42833fda716056321cb7b0daa2
BLAKE2b-256 checksum
How to use checksums
d9dcda3a18a41af2297bd03ccb8168b8e4e0b973fffa785ccdef718f280cddf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / swavepy-0.0.2-py3-none-any.whl

Download URL swavepy-0.0.2-py3-none-any.whl
Size 43.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35f87e7a577b45fe7c9a4c0209b868264217cdb6630eef136b88e572b6678254
BLAKE2b-256 checksum
How to use checksums
9271fff73cdb511859f66817d372487aa507a760eba608fe021906dcd0e8d654
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for swavepy 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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