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.1.0.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.1.0-cp314-cp314-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.14Windows x86-64

pygrnwang-2.1.0-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.1.0-cp314-cp314-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

pygrnwang-2.1.0-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.1.0-cp313-cp313-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

pygrnwang-2.1.0-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.1.0-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.1.0.tar.gz.

File metadata

  • Download URL: pygrnwang-2.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 d8bbd5f3f01da2c5845f95ee8a019c1cc993a31ed7e026dc91c0e1beb5bbde9b
MD5 2b3be5b434b0dd217e9f0b2661482599
BLAKE2b-256 7ae8f25e893a1c6399dbc93db385bb3008758ce37595df1bc7a01c7aeae2a4b5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.0-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.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 70f41fa978f0adc829e9dda7cf76ea7cb67893ae2d9d75f4becec2b8fec4b3af
MD5 af5e36b1a1b635da848e79b6f94b809c
BLAKE2b-256 0185c0bb62c47f84885ef5959259bf57f270948f1066c8c22a1aae163b6b7594

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 98595f32438deed2f0f1d8fc0882873f0504face7490b6419337e1efd6201895
MD5 276dbc77f057dc06a707fa144a9021fb
BLAKE2b-256 69195715f99e4ec8cbd7a6b7d957afcd15b84ca8650831f7ecd7b4a55fa26da7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 895a43effe25546c7c773f4a2dadd8f9ba1655de564b45d4e703c4428d02f28f
MD5 51abdd94e56aeec09e450d16bc8f76c8
BLAKE2b-256 7a760e4b13b9e83551ccfc5bbe1a2dd6350cffe1e564a7925c499e11ae5212ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.0-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.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.1.0-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.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e15a6dd5236ee21f9e8f06d07ec7ceb93dfc75c2ac3420857de738aa77e7446a
MD5 6b79cb5edb0b80144ad2afdbd4f141ff
BLAKE2b-256 1a35726c98ee23f41439c987f1ca0f4e7511d89c0fc7604fabf79cae75663a00

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f5945f5ba1b32fcbf9731ddc7129b60f26510d58dd05e075631d1f03efdb02ff
MD5 9590d6e9d92f398564e3f7961a82316a
BLAKE2b-256 4f9b709f79a599affe6777064ff54a6d8e9289d432e0da8dfc221b9a78eaec09

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1d26687af63064ca9bcad1c54ddb428b67bb2d4d5ca7bd80422c370a107f5d44
MD5 47c4ece2fca1746235b912c4549bb137
BLAKE2b-256 5b48d4beab8c29724e72a2fef34a79237fb7512bbfdf18d7606b8f3f121f6e16

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.0-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.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.1.0-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.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 06ccae5303449fe843bc0e6ba8c4debaee7b54806eb334be6071d5d1865dade2
MD5 a2e70a2c38886a257f70e90c89da3272
BLAKE2b-256 02245674f53f7bc65ecf07528fb3174720139a3bea07a29ed0ce2b3248f25660

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.0-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.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 d3144000726a5801009aa12ded0e38b7260874c9fff2a98940d993453f41e235
MD5 9809fe1c02e5931c8bca3b57a6820bdf
BLAKE2b-256 edabff2476d3c68929d8aa569490b765f789c0b9097ba3a96954aa85d5a29f22

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f02b3c3c3e2287b707b8067cacedd206d5fdbd4f3e20abdcf621ca4783148be7
MD5 8a4786685b65d197509cf86170c54288
BLAKE2b-256 2849cfa4716274d21605489df18a6e587252622faa05797c7c1dae66ee588c74

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.0-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.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.1.0-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.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 db6d59839524513bdf96c8ea87c5af8172e2cd860763f7d11277bd79e076c90a
MD5 67d0090e57ab7ac07fa9598a06dd4a9b
BLAKE2b-256 c6f64892d754993a30b84a12ac0ccc2f33c579828435473d0ac14b98875dae05

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.0-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.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 fc6e05c91b2f6f4ce974086aab5098042d1bbd74549a78a7120f0db770f1348f
MD5 20fb65be36c0ed41996804b9439582a9
BLAKE2b-256 9aab45f98eeb51d10fbee4d2b1731fe10b0206bebbe1e5a2f42536cf06e01c24

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3d11cb9bdc5966e31f0ccb04f14fb0c15a6404282ecf964c3df05896cced5112
MD5 92597a0e4615bfe251b4886e1abd7c95
BLAKE2b-256 20ced31f84383b533ca7b15e9f5bc27865255f684d6d31118d941bd4ebcd5c60

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.0-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.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pygrnwang-2.1.0-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.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1c37aa924a27d982372d0eb8bc3b060db2c4c78ebe945d65ddda54598096ea90
MD5 06ba9496f07a6bcf838758cb1b391490
BLAKE2b-256 008790b28b3bc2a61fb5d930899e5d610dd35a31aaac6705fd11dd903328183e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.0-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.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a067b2da89239e65cdf6434e6211cf5c50ebeff854425719a275d5d6e5d5aee3
MD5 098a4c48d36e6b5cdbdc43f55ad200bb
BLAKE2b-256 0f37137141e6f0008e051bd7ae81a343b880002cad1f83f778de4b89f82dfb51

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fc0396228396c8fe66af8c350bced6057ecba46ed0c52eb5797eb3b651f04ddd
MD5 3ef2d54438bf94168778fee30d11c4cb
BLAKE2b-256 cc2e4ab20f6d7b3037a299da973d373e1270516e94084df9d34f2862e570f7dc

See more details on using hashes here.

Provenance

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