Skip to main content

A Python library for computing Coulomb Failure Stress Change.

Project description

Introduction

This Python package serves as the frontend for calculating and building a Green's function library for synthetic seismograms. The backend consists of Wang Rongjiang's program for calculating synthetic seismograms, including EDGRN/EDCMP, QSEIS_STRESS, SPGRN, and QSSP (Wang, 1999; Wang 2003; Wang and Wang 2007; Wang et al., 2017). The code includes two parallel modes: one using the multiprocessing library (single-node multi-process) and the other using MPI (multi-node).

Installation

  1. For user mode (with Python 3.12)
pip install pygrnwang
  1. For developer mode
conda create -n pygrnwang python=3.12
conda install "setuptools<81" obspy tqdm mpi4py gfortran -c conda-forge
git clone https://github.com/Zhou-Jiangcheng/pygrnwang.git
cd pygrnwang
pip install -e .

Usage

  1. An example for creating a Green's function library with qssp2020
from pygrnwang.create_qssp2020_bulk import *

if __name__ == '__main__':
    wavelet_duration = 0
    sampling_interval = 1
    time_window = 4096 - sampling_interval
    path_green = r'path\grns_qssp2020\ak135fc'
    os.makedirs(path_green, exist_ok=True)
    output_observables = [0 for _ in range(11)]
    output_observables[0] = 1
    output_observables[1] = 1
    output_observables[2] = 1
    pre_process_qssp2020(
        processes_num=24,
        path_green=path_green,
        event_depth_list=[h for h in range(1, 41, 2)],
        receiver_depth_list=[0],
        dist_range=[3000, 12000],
        delta_dist=10,
        spec_time_window=time_window,
        sampling_interval=sampling_interval,
        max_frequency=0.2,
        max_slowness=0.4,
        anti_alias=0.01,
        turning_point_filter=0,
        turning_point_d1=0,
        turning_point_d2=0,
        free_surface_filter=1,
        gravity_fc=0,
        gravity_harmonic=0,
        cal_sph=1,
        cal_tor=1,
        min_harmonic=4000,
        max_harmonic=10000,
        source_radius=0,
        source_duration=wavelet_duration * sampling_interval,
        output_observables=output_observables,
        time_window=time_window,
        time_reduction=-20,
        path_nd=r'path\ak135fc.nd',
        earth_model_layer_num=None,
        physical_dispersion=0,
        check_finished_tpts_table=False
    )
    create_grnlib_qssp2020_parallel(
        path_green=path_green, check_finished=False, cal_spec=False
    )

  1. An example for reading from a Green's function library created by qssp2020
from pygrnwang.read_qssp2020 import seek_qssp2020


if __name__ == "__main__":
    seismograms, tpts_table, first_p, first_s, grn_dep, grn_receiver, green_dist = (
        seek_qssp2020(
            path_green="/e/grns_test/test_qssp",
            event_depth_km=10,
            receiver_depth_km=0,
            az_deg=60,
            dist_km=5000,
            focal_mechanism=[30, 40, 50],
            srate=1,
            before_p=20,
            pad_zeros=False,
            shift=False,
            rotate=True,
            only_seismograms=False,
            output_type='disp',
            model_name=r"path\ak135fc.nd",
        )
    )

    import matplotlib.pyplot as plt
    fig, axs = plt.subplots(nrows=3, ncols=1)
    axs[0].plot(seismograms[0])
    axs[1].plot(seismograms[1])
    axs[2].plot(seismograms[2])
    plt.show()

Reference

Wang, R. (1999). A simple orthonormalization method for stable and efficient computation of Green’s functions. Bulletin of the Seismological Society of America , 89 (3), 733–741. https://doi.org/10.1785/BSSA0890030733

Wang, R. (2003). Computation of deformation induced by earthquakes in a multi-layered elastic crust—FORTRAN programs EDGRN/EDCMP. Computers & Geosciences, 29(2), 195–207. https://doi.org/10.1016/S0098-3004(02)00111-5

Wang, R., & Wang, H. (2007). A fast converging and anti-aliasing algorithm for green’s functions in terms of spherical or cylindrical harmonics. Geophysical Journal International, 170(1), 239–248. https://doi.org/10.1111/j.1365-246X.2007.03385.x

Wang, R., Heimann, S., Zhang, Y., Wang, H., & Dahm, T. (2017). Complete synthetic seismograms based on a spherical self-gravitating earth model with an atmosphere–ocean–mantle–core structure. Geophysical Journal International, 210(3), 1739–1764. https://doi.org/10.1093/gji/ggx259

Zhou, J., Wang, R., & Zhang, Y. (2026). DynCFS: a program for modeling dynamic coulomb failure stress changes in layered elastic media. Geophysical Journal International, ggaf534. https://doi.org/10.1093/gji/ggaf534

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

pygrnwang-2.0.4.tar.gz (278.0 kB view details)

Uploaded Source

Built Distributions

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

pygrnwang-2.0.4-cp312-cp312-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.12Windows x86-64

pygrnwang-2.0.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

pygrnwang-2.0.4-cp311-cp311-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.11Windows x86-64

pygrnwang-2.0.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

pygrnwang-2.0.4-cp310-cp310-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.10Windows x86-64

pygrnwang-2.0.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file pygrnwang-2.0.4.tar.gz.

File metadata

  • Download URL: pygrnwang-2.0.4.tar.gz
  • Upload date:
  • Size: 278.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygrnwang-2.0.4.tar.gz
Algorithm Hash digest
SHA256 2b38b8848481a51bdb408ca4777f1489d78a6f103d728103e63f9278eb8ceb66
MD5 7688eda26ff1cc470df164c20a43f7a7
BLAKE2b-256 b13a1e0a882c70f7b26a188b65c3b2a944ff945c613c96840b7119857245440e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.4.tar.gz:

Publisher: publish.yml on Zhou-Jiangcheng/pygrnwang

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

File details

Details for the file pygrnwang-2.0.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.0.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygrnwang-2.0.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 096d1e60dbc15f2b95e1382b13eb3763b8186aa3b4c810245adb6e6f2e17f6f0
MD5 34faea1119e198fe232b00e5636f0a5e
BLAKE2b-256 eebad7ba541c5ab98679dec26b410d600cfbd9e8bd8bf74db31c4798ddca844c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.4-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on Zhou-Jiangcheng/pygrnwang

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

File details

Details for the file pygrnwang-2.0.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8d58c1d40f7d26cdc7d9517d70f29103ca9351108b49335723478501bd9df4e4
MD5 a0cb16e9ea418a8b22f272be5b5e29f8
BLAKE2b-256 a731764ca63d342b22f5d9aad4b7d01de2d30a388525725c969041e308a8e242

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: publish.yml on Zhou-Jiangcheng/pygrnwang

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

File details

Details for the file pygrnwang-2.0.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.0.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygrnwang-2.0.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2dc6953a88aa2f520645137d660021168806623c695a2e821d124dfed9181fb9
MD5 0849decebdd7439f51f8e0a8eaed0ae7
BLAKE2b-256 bc92addcbbbda9cf43d23d80d16ec7c1392589d9336654ab9dd19f43d89917d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.4-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on Zhou-Jiangcheng/pygrnwang

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

File details

Details for the file pygrnwang-2.0.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f960ea6c53eadf9bad796116830b0d94c131d0f901cc82ac3f0e249bf5bc95c2
MD5 05afb5a9b8df164501f15330707890bc
BLAKE2b-256 2e77b6538712f4a9fd0b5c7acb0998ec9677eb20370619e97a3ec2d8bbe0fef4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: publish.yml on Zhou-Jiangcheng/pygrnwang

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

File details

Details for the file pygrnwang-2.0.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.0.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pygrnwang-2.0.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ebbb0cd22522cab4cac8e4146dd87a58208dc291fd05d85fb0503a7c274d915e
MD5 472aba45206609958b8be9a9189c4dee
BLAKE2b-256 a8e1fe9473b5300591c02cea20357b4e2a584468299ee0d6a83c1a2f7d346bbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.4-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on Zhou-Jiangcheng/pygrnwang

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

File details

Details for the file pygrnwang-2.0.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 1671bc881c058646d71c35de12a7db0bfd8bb24e5cddd7e8ca0e0b05639ca819
MD5 5780dfc5ed7650d2ac92b68700e086c4
BLAKE2b-256 a10c706eefeaf560c5f9191b217d0a1e399a05267e605e02803ebcf252900548

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: publish.yml on Zhou-Jiangcheng/pygrnwang

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