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
pip install pygrnwang
  1. For developer mode
conda create -n pygrnwang python=3.14
conda install 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.9.tar.gz (276.7 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.9-cp314-cp314-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.14Windows x86-64

pygrnwang-2.0.9-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (7.4 MB view details)

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

pygrnwang-2.0.9-cp314-cp314-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

pygrnwang-2.0.9-cp313-cp313-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.13Windows x86-64

pygrnwang-2.0.9-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (7.4 MB view details)

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

pygrnwang-2.0.9-cp313-cp313-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

pygrnwang-2.0.9-cp312-cp312-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.12Windows x86-64

pygrnwang-2.0.9-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.9-cp312-cp312-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

pygrnwang-2.0.9-cp311-cp311-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.11Windows x86-64

pygrnwang-2.0.9-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.9-cp311-cp311-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

pygrnwang-2.0.9-cp310-cp310-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.10Windows x86-64

pygrnwang-2.0.9-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

pygrnwang-2.0.9-cp310-cp310-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: pygrnwang-2.0.9.tar.gz
  • Upload date:
  • Size: 276.7 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.9.tar.gz
Algorithm Hash digest
SHA256 6d78259dcb2a6ca348d6d3fff2255d8831bf83a3e113a6a0acf27256d4abf757
MD5 be527ec5140bc11c2d8c6b6885c9b3fc
BLAKE2b-256 5cfe6a47a834292aa10202ff4762bcac53102e9f154c87f9c435d9deb69fa5ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9.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.9-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.0.9-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.14, 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.9-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c558893b2ae4a1903cc276195659ee65697a14f2d72eb26241c6d5009f7d0fee
MD5 c5e25b5dcff418a5d88e625e723a93fb
BLAKE2b-256 0213e55abfe01d93f200fcebf1006a2d73b1059021d1d4d5bb7a4431587392a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp314-cp314-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.9-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.9-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 7d87097cbe9ec0e33aedc663985cf71ada04cb20874b57abbe7aaffddd23cdb5
MD5 c9ecfaed88c85aab33805c5bc8b1ba84
BLAKE2b-256 064316dbfdca83396f831b642281929f67e6034046463dddb855cfa06642943b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp314-cp314-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.9-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.9-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8ad6e7bc99386638c57e919c2ff84f6be8c576d434a66000d51fd3ad43df2657
MD5 4cde24b0233b3a195bc01959d80ef1ca
BLAKE2b-256 fc6c521f6f5e36e2a3fa00d1fe1eed95dca8fc1ee08b6fbd93d3b0d824b7db0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp314-cp314-macosx_15_0_arm64.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.9-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.0.9-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.13, 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.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e4b545e25fbf7aec7efe679996996028090167017eaa9ef90f66b0bee1652f1b
MD5 0e413cfab1770da4fdd5be4dbd10933c
BLAKE2b-256 a1f937782d25d20a3a876a0bf7ce747fa2e233f35c18955d12ff66bea12ff592

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp313-cp313-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.9-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.9-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 01f91953bf2e5df49755494cbf3724de484ae92aeae664338cb38fa362974cd3
MD5 61065e208afb65e442828ef1efafcf28
BLAKE2b-256 341014aed7888b9e9efb368840ce54ac8474aee844b570a25f4a2487aaa8072e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp313-cp313-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.9-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.9-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 59906ab12331f22d9d037b8e0b123e699a21f8625509b36d7609792ebe2ecd6c
MD5 66faa8be5672204f33dcf040608b978e
BLAKE2b-256 31cc5ada16468dbf4f91faaccda6fd5244fac325aef5f6a0bc4ba95184b76e83

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp313-cp313-macosx_15_0_arm64.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.9-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.0.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.8 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.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 04ec8c1fe1e8e403626a178d78cfd7b49e6af4f4c13dc3354f1df9194b686eeb
MD5 2e75fb1330da2007b6b2a1538b9fcfdf
BLAKE2b-256 064980540b41da9105e242ca84862bf5428cfb27fb88f76d198b1747dc9fff4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-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.9-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.9-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a7022d1dba76254e9c03b8d8b634e0d4560d3e9a025c6b849281c8b262e6dcf8
MD5 28716f1590e6ede898d9b80ceb9a05d5
BLAKE2b-256 44a75edd1e646df4bb9e787746813c3221d472420261b130aa77ba2d217f7436

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-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.9-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.9-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d8db767f842cdf578f8642d5cd59ca0368b1fa15e068bab1b756a1632f4a2571
MD5 26e1dc014d278417737b55ba52436500
BLAKE2b-256 95bc6d31ed4b752de1149d22b29d418680c77b6ef94c6bcbdd4c839211c10364

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp312-cp312-macosx_15_0_arm64.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.9-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.0.9-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.8 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.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3325de89744acb278a32d7d5d7dd39eef87cb3e51d48685d75db027c4ab040ac
MD5 9cd8afcb05451c9904c492366ccccc95
BLAKE2b-256 d09f2d552f72dbee5116b69833b05672d23fe99c364c330c75058f2891114c58

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-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.9-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.9-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 91d9048b1e5efd769ff0866e38b552c32608481a35e52a2dbea368fb388739c6
MD5 3e650005ed89718712de0f26b5b65196
BLAKE2b-256 d24a1bb4a80e663827216fd480d23a665150512deb2821752d7886e4dc5ec303

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-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.9-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.9-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 69e68fe0dad8dd7e5aa318c35aa4ec6aad22a2a14d03673ffc0ce3534faa255f
MD5 1d032a26988036eaae3c49fdffab75ce
BLAKE2b-256 4f53153e799a0ce4180a9a91ac77355b013fccdeed71ff2c0eb22bd3615a612e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp311-cp311-macosx_15_0_arm64.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.9-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.0.9-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.8 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.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 29511c885f5517e3099fb4ef29fa0f56989cac3d23980013714540954c7b1e4a
MD5 87f66c019c9083b0ef04f82954e2afc0
BLAKE2b-256 bc9fb8745563b5274161146ae6be96f5e4bfe108d6cdbb3a52e36e477b7d1900

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-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.9-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.9-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f75de0705499742bdc7834cfbcd684b645f28e790d37b81769da4eae8bfe7d5a
MD5 045884f00ec2eb636453dc1c29bd4122
BLAKE2b-256 173ae8ffb723511dbc8a0cc70de3c11dec99288f988a10e3bcf56a4395ab50ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-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.

File details

Details for the file pygrnwang-2.0.9-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.0.9-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bac4f8b7ea29f45d4e4655bcfcb29e822c09766e717302179db6002eb7169f31
MD5 4617d4963decd6690596d46d30283074
BLAKE2b-256 6edf5d17472c2d1d06b1e9e7fe54beec7de6bcaeabd7c0191e2ebadf5b38370b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.9-cp310-cp310-macosx_15_0_arm64.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