Skip to main content

An Efficient and Integrated Python Package for Computing Synthetic Seismograms in a Layered Half-Space Model

Project description

Image 2

GitHub code size in bytes GitHub Actions Workflow Status Github Tag GitHub License

Like this project? Give it a Star!

中文文档

Overview

PyGRT: An Efficient and Integrated Python Package for Computing Synthetic Seismograms, Strain and Stress in a Layered Half-Space Model (Dynamic & Static Cases)

PyGRT now can compute following properties in both dynamic and static case.

  • Displacements and its spatial derivatives
  • Strain
  • Stress

At present, PyGRT can run on

  • Linux
  • macOS
  • Windows

PyGRT is still evolving, and more features will be released in the future.

Features

  • Dual-Language:
    To optimize performance, PyGRT uses C for its core computational tasks, while Python provides a user-friendly interface. Support script style and command line style to run the program.

  • Parallelization:
    Accelerated with OpenMP for parallel processing.

  • Integration:
    Built on the Generalized Reflection-Transmission matrix Method (GRTM) and the Discrete Wavenumber Method (DWM), PyGRT integrates the Peak-Trough Averaging Method (PTAM) and Filon’s Integration Method (FIM) to handle diverse source-receiver distributions.

  • Modular Design:
    Clean and organized code structure, making it easy to extend and maintain.

  • Compatibility:
    PyGRT provides pre-compiled static files, ensuring ease of installation, usage, and portability across different systems.

Image 2

Pre-Requisite

  • For Thread-Level Parallel Computing
    • OpenMP

      • For Linux and macOS users: If the GNU compiler is installed on your system, the OpenMP library is usually included.
      • For Windows users: OpenMP has been statically linked.

      In general, you don't have to worry about it. However, if the program complains that "libgomp.so not found" or "needs more dependencies", you should install OpenMP.


  • For Python Script Style
    • Anaconda (recommend), to build your virtual environment.
    • Other dependencies are declared in setup.py, automatically handled by pip install.

  • For Command Line Style
    the output waveforms are binary files in SAC format, you need Seismic Analysis Code (SAC) to view and process.

Installation

In PyGRT, the C programs and libraries operate independently of Python (not CPython or Cython). If you are not familiar with Python and pip, and prefer the Command Line Style, you can quickly run the program by downloading the latest GitHub release for your machine. The necessary files are located in the pygrt/C_extension/bin and pygrt/C_extension/lib folders.


Two ways, choose one:

  1. PYPI (recommend)
    Run the following command in your virtual environment:

    pip install -v pygrt-kit
    
  2. Github release

    • Download the latest release for your machine, uncompress, and change the directory.

    • Run the following command in your virtual environment:

      pip install -v .
      
  3. Build from Source Code.
    Not recommend.

Setting

For Command Line Style, run

python -m pygrt.print

the outputs are

PyGRT installation directory: </path/to/installation>
PyGRT executable file directory: </path/to/installation/bin>
PyGRT library directory: </path/to/installation/lib>

and you can

  • add "executable file directory" to PATH environment variable.

Then you can run the command like grt in terminal.
For each command, use -h to see the help message.

Usage Example

example/ folder shows some examples in paper. More examples are coming soon.

multi traces lamb problem far-field record

static_dc static_sf static_exp

Contact

If you have any questions or suggestions, feel free to reach out:

Citation

Zhu D., J. Wang*, J. Hao, S. Yao, Y. Xu, T. Xu and Z. Yao (2025). PyGRT: An Efficient and Integrated Python Package for Computing Synthetic Seismograms in a Layered Half-Space Model. Seismological Research Letters. (under review)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pygrt_kit-0.5.1-py3-none-win_amd64.whl (5.9 MB view details)

Uploaded Python 3Windows x86-64

pygrt_kit-0.5.1-py3-none-manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded Python 3

pygrt_kit-0.5.1-py3-none-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

pygrt_kit-0.5.1-py3-none-macosx_10_9_x86_64.whl (3.4 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file pygrt_kit-0.5.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: pygrt_kit-0.5.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pygrt_kit-0.5.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b7feb801f9edd78601fa17a48d8e25f5378d537e8d91c62469ca276a65f1125e
MD5 4978aaca72597f958b8de0a5eec12c84
BLAKE2b-256 33732d4a0a94f1e9be25f3db37ececc68e758e8e18aef85bdeb9f840d172df12

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrt_kit-0.5.1-py3-none-win_amd64.whl:

Publisher: build.yml on Dengda98/PyGRT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrt_kit-0.5.1-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pygrt_kit-0.5.1-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c5ff21e52ebf0cb8fcfb4a2c90d332b194c6272539aece7e3ad2bdbdd399094
MD5 39d4f519c923dde8383ee5cf5f4f94a9
BLAKE2b-256 2413730d66567e4df0dee09fbd5ae38e4efcc05bbe935c253309fc627b2a34b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrt_kit-0.5.1-py3-none-manylinux2014_x86_64.whl:

Publisher: build.yml on Dengda98/PyGRT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrt_kit-0.5.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pygrt_kit-0.5.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dac718c29d00ee7044c5b628f3e8d96bb57db74cc0d0a92fcccd756dd6fa3874
MD5 b3bb7173dd62fc8930f83d6627366f9a
BLAKE2b-256 254deab33eedde1b4f9bab95ee845b5f6ece4431479ef1a50140a0b8af3f7dbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrt_kit-0.5.1-py3-none-macosx_11_0_arm64.whl:

Publisher: build.yml on Dengda98/PyGRT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygrt_kit-0.5.1-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pygrt_kit-0.5.1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cff25451e2043ebc094cdd81ec59ae6c599114c57fc20964c8266a1af1bb03db
MD5 0ad43b38d76143d035e21c1d7646d1bf
BLAKE2b-256 5d144005c9f21f871d6992462bfe5f7abc5259f34e6021815a22ed21f0f81206

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrt_kit-0.5.1-py3-none-macosx_10_9_x86_64.whl:

Publisher: build.yml on Dengda98/PyGRT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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