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.5.tar.gz (277.9 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.5-cp313-cp313-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

File metadata

  • Download URL: pygrnwang-2.0.5.tar.gz
  • Upload date:
  • Size: 277.9 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.5.tar.gz
Algorithm Hash digest
SHA256 ebd4c15505df8afb0035a59224f506c6e64559c006318d1e61da8629f48dc9c4
MD5 0f71b4ca816dc77ef5f1d1f7b2330215
BLAKE2b-256 7ea01895001688d25d035f23d8efc786d619e2eb482c2bff45fbb27936aeb72d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.5-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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 854a24311c3fe00e5e684d155d4f64433420870da01145c0dd663f7e980b98c4
MD5 b9882b18465e264536dfccd4a33c85f8
BLAKE2b-256 76047623798fc6fedef1d44395f9671d637fcd258a5970ea50ea7cc8591d1d0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.5-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.5-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.5-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 5243a9fb6b249b0973961bac7b250b34f8a9c7e527922110cd99c92efb9641ad
MD5 ebcdd9b897d701d21fff0a35089c711b
BLAKE2b-256 50efc2552b9468a9aed43f24b9843a49e8094f4c8cc2b95640159f9300435ad7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.5-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 256441943b1c6fcc075f368c9869ed4dcb9d7e106738eb17d28da30cfb3680a5
MD5 0f43568f2493e259f051c789a3cecb7b
BLAKE2b-256 8921593ea02e2dc3284088473d0a831295326b417df9b1389dac86a64b22b4b8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.5-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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 157b22e40c1200a2fd8dce52b8b7d16a061c111a40bc9e05fb6c47fc5a9fa9cf
MD5 46fc733d193e4d99a74507015adcc666
BLAKE2b-256 57609b9ad3868c8eb7220d9932414a0ac5a9f0e39350b1a9143a8e788e394821

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.5-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.5-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.5-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 81cdb192d167ab6a935877de09613225631191268ee12e1c698773162d9b9d00
MD5 89480d06654255a838840f8f87796630
BLAKE2b-256 765dd231d9f762d5d4bcf3134e00f191ad98199e398c2bda9b86609d8c599d3d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.5-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 54e07e2274c6289c0df2877225a96da5980a9f8f07006c2d92b9702de8b38c14
MD5 9e928abb3adefaa7f92b1e8d0f0e1b1e
BLAKE2b-256 b244006487848f24b8e014b86be1e48eabf1d79354ca7492508deeefd1c1c58e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.5-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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9802219a3778ab3d91593694ce42b0056e24e4204ed14209e376a5894cafb369
MD5 1ffe5756859f1a4a4c9a725d3a620d67
BLAKE2b-256 7cacbb63cc12f6b6b1bc95b30cccee9ff950c0caff8810e0b482c40a43441343

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.5-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.5-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.5-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 663b24cc3a471bdff8ee785f765cdfd56fd6fbdb7152855c63034bf81ca23b65
MD5 ff06c1f0c6029397971d0ee10189c8c2
BLAKE2b-256 e2e5ceca4fce9ae23908fcf4d9fb72ba32d75909c443664c1ac347033a6d5f48

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.5-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e5c87f32c505a0238fbff0b531bd5228ae8476c69d40377fe4f1f9fac40f77ea
MD5 f2edaf6351b2c10c0a9523108a923182
BLAKE2b-256 6d39a3c93f8249abe07d752254f398cd35ea349863ef002e6e984b63f382b219

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.5-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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b201d6dd9c9226fb587101e9edb6608af8c15337a47a4d008c9ef069c231381e
MD5 b3658c4d109893260ca4b0e5a2edba2e
BLAKE2b-256 972119be5478c2095875b36faec3d907f618cf9e9f1c56c0dcbb7590611bd723

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.5-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.5-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.5-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 2e178927fa9c1c614250c6c48f980f44f4a9a16cc41380f7a756a6a527935cfc
MD5 82791c50798b43e6f5858555f09bd143
BLAKE2b-256 fa85cafeedb8bd928d3b38520f409aa3f60de8bd4878af1dbb93c1dfd93eb92c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.5-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 081c7ca094f9359b3c855641acc9329cb5d12f60cefef2bc321e5bcc2e2ab686
MD5 5a460a5d49de9e7d533fe8f627151017
BLAKE2b-256 abae707981b287002fd599b2ac12ece6491a54aa783fe6de4f651cdd544c30e3

See more details on using hashes here.

Provenance

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