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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

File metadata

  • Download URL: pygrnwang-2.0.7.tar.gz
  • Upload date:
  • Size: 275.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.7.tar.gz
Algorithm Hash digest
SHA256 3397a8b3eab8830637155a2362c89518931e01b47147db8f176f01354a78329b
MD5 5ad0b6b0e35b9a6be5bb53127afebd12
BLAKE2b-256 51afccdd09ba120968afb05f7ae1fdf951c12d38da0c4193f860cae209b9e89b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.7-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.7-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 3b4b32e20c1036c770297ca384c205dcd2059ace2a5c2c4f6972059788a325f6
MD5 5f107d043a1a363c003873f179092c8e
BLAKE2b-256 cb46d17f60b6dcaf5d067be576b7b2fbb11b14c2b96224c1bff6ecef41d3dc9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.7-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.7-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.7-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 f4598b57522e05379ed6d7dd6d509388f6ec4ceb233061e5a3d141fe4012b4c9
MD5 61b12d84bdb7b533f92548e05bf151ac
BLAKE2b-256 861a822337e042e013b79117d47d3cef4f38b9027fddcca26cee90befa341769

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.7-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a3ddec0bf61436181be20fcedab0bb891892d7950067c3ffedbfa7b8e9c92a85
MD5 873d1adcfe67e4211944c4dad73dedd3
BLAKE2b-256 511420f22eac38b4096f80ec63ace781805f9a95eac79af7412dfddcf9de20d1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.7-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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e001e409af7ba68833ef578be4588cfa61bcc00520caf12a090524b7d7461fd3
MD5 48a0b46143dc159088e0d432be31c744
BLAKE2b-256 b184f0458bd9ea86908383afd24fdef7f5526aa0b5f945bc51d0586ebd24b752

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.7-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.7-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.7-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 59ed8203d10e7362e5c04cf8d20011f9a0897ba6f794fc43f9f691f2c8c0a715
MD5 98a2db77ac099972ad755f7c29c08b66
BLAKE2b-256 b1d2045c92aedcc0de5853381e1f4d83b5263764c1968f2b1ea79d4e51e62101

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.7-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c96d75cacd7a633fae0bde2de37ac312e5eb42ced30678d50fb470b031a1a026
MD5 8ae6a7037a8a4891e77ea901ae0d637e
BLAKE2b-256 6e0d1960f76be814af08e4f989961c61e3c761b092035ef0bddaca94e298ec94

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.7-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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1930e9603c2e2000ecc50736115f5a447b6f56a625e5c5a3489069eb3d31cf1b
MD5 4607c5de48e10b01884eaf64ab7223e1
BLAKE2b-256 2f039b25d129e48dc01545d985f60eb2170ed89652052b21530fee0863f83c33

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.7-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.7-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.7-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 bcca385738411b205139864af83a42b47a1a52be3469b20630c99dee3675be93
MD5 508e4ad9c7b746573b82ecfb1558b826
BLAKE2b-256 872f33e007ccd2716b5a45148fec5bd20447c4ab110521a6aa7ee554f3edcd39

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.7-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 268325f606289641ff9e0c37bb517912a4be36f7c81a0ad60f03578caa76e928
MD5 8693033684fb2cf1f774a8e11d53f850
BLAKE2b-256 7fc4b2a8ddc8aa0fe44bc4d998472096aa41310915470ff098a0ff1b8a4aa9b7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.7-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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7005089325ed1abec92868ac81052663588009f106008d389d7aa324ac14fc7b
MD5 5b6e6a7588df46e979258ef40ba0ef26
BLAKE2b-256 ae5d92d8b9aecc2a8829b733a86a252e0139bd3447485169782575420a058a2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.7-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.7-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.7-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 56ea176818685d17223c11624bc89d49609bf55584752b7fda1509a4d5483272
MD5 8905e9f8283cf580f0a922b2f6fd006c
BLAKE2b-256 5d125960076100759729562d00fc2ac4d4da99690ffac8ea1931a376946dede7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.7-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d3107f138175e6ea96ad035de62320f282a6a3166f31e79b897ba9cdb5b58220
MD5 2136c3ac73ef40d9ccf0e5ac6a7962e1
BLAKE2b-256 24ff529d6611d69309045ac92fb75d3cb5edfa2161458b98bf7219107bcfa21b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.7-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.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 946d6d5e4653609592454a2221e4e9c475ac42f50087e934c4eaaa01ada1383d
MD5 aa903e2446c734a56e810587626d5509
BLAKE2b-256 64476bfad1d3c55a283d69c46904ed01569cc8469b7caacc78af446a4936571c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.7-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.7-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.7-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 eb640bdf0f99719a3879fab9763d4b565825c6184d289ee22a0383e70431999d
MD5 6460fafebcde9f1179f4b5acf3a42c0a
BLAKE2b-256 b301cfc5bcfd9851b221c711036763083dee8b72bd1283c00ab19ca4373ce685

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.7-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 92b97d5617871990de25c15c15bbc7d19c6e261c4670f4f65c578c507b993ac1
MD5 b60f41f82488c4989bbd3722cb5e5921
BLAKE2b-256 aaad75f7bd94209efa626a5a3555303c3f534b5d149ba32bd18a103cb729d72a

See more details on using hashes here.

Provenance

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