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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

File metadata

  • Download URL: pygrnwang-2.0.6.tar.gz
  • Upload date:
  • Size: 277.2 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.6.tar.gz
Algorithm Hash digest
SHA256 70912e6fd864c8469f826fd043f171c9aece1e6e309025b6ac03a5a65e094452
MD5 f737d190b73e987d069e395699eee5e3
BLAKE2b-256 7f862dcbc8acd4e69fb5611832cfa4d3f3829ee98abf17a79e8c9d93cb6e7a0b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.6-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.6-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1cce0b9e650f885fd738341eae61f2b81bb8ca751510fe0b57e4ea87aa0b38df
MD5 47cf5328fe6ba962f302a65bfe8c5ea8
BLAKE2b-256 3e42adbce2747974c019f06f1633638be803f23556983afabc7613f9f04a07c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.6-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.6-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.6-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 2eeaa6e4c7771b00fd21522378b037c853a1747d71756a4d9664470676e459b8
MD5 3fdcb0bf9b7a3376121222b6eb246ac3
BLAKE2b-256 5202198df28a58cce863ee512c661c7fbfd7bb0606d49770414e2ec4a29d12c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.6-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c0a0ce480ef91e01529472b0aa263e6fbc95ebca61074879e53915bc505e2741
MD5 289fcc13024e3ed918e6eeca4023433d
BLAKE2b-256 ba668ae245457f847319ae5b6f48ddcd59ee7238a57ca3ad6e3d3fdcba08852c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.6-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.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7f6a6c82b0d92153924780a6b85374095312c0d6791c8401deee02b728c4d30f
MD5 d6232bfe5bc9492b5cccd26b2c693308
BLAKE2b-256 0929c209c3269b9c5040d0e4c2587454a8fa30429bf5956a828e430bc121a662

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.6-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.6-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.6-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 de18e205887d8b76d729fe7f99ec149d3ea66c91317ca2d5cef9e87582278a2e
MD5 1a23c335cc99f4325e0d2933012667c5
BLAKE2b-256 cdf83596705359cf762bee2d56fc5a9355b56aadb8567e7aca1884eb6522c39e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.6-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4ad60131e378ca72c44631ab31fdf30eae10e79ef282a5410b851fee5eedf9a3
MD5 8f2092f19e72e2750975e4a9f74a4be7
BLAKE2b-256 a01bc7f016fa1c82de776e1bda6207ebafc36c473f812e3973a15e3464d94c16

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.6-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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8187319794faaf5720ccfe7969e9b0d0817de56d53eb68619252009a3f51a348
MD5 b43ed79662e281fad3fcbf67cd1134e2
BLAKE2b-256 33bfcd0a35b98808c80775ea4661efc08f2f01529e288223db8ca763b8a115c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.6-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.6-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.6-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 0e22cf74c4653c62853d343f1b3e49882f21262a96f68824475cb8235ed26dd3
MD5 f58f2caf159432e779adcaa045e21ebe
BLAKE2b-256 c71e9e178732aa1696522d3700b7408857bec6c0c7ed5b97b555013d69b4c5a6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.6-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 60dcb28f9cebf6c7ead318993fca4becedd539009a05b43c63d580018fb586f7
MD5 2823ef3f1dd2ba8146352faeea9f27f6
BLAKE2b-256 7c72f6128b3c60bc39f22c279d3ff98e5a3dd10439c0a843262fb7761322be2b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.6-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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 515d744b637d7981aff5d5a1aafb7c30e84f13c420f7d895c8168ad9583c000e
MD5 351ecd89cb92c709a429393bb17863c9
BLAKE2b-256 e748ae3fc521828ed854d3392b4a5660f9796c6d6ddf7a087d1cd001fab1ffc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.6-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.6-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.6-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 9b750471e530b7651e97cc5db80494daa279966172301d96d52b2ead53ee7129
MD5 7d871c7ed3b0ab11e3a1c9fc7cdc0fc5
BLAKE2b-256 657e5029f25f06d72ab9a9e39f331d3c357c78dad125558488d4b06314fd8314

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.6-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7e76ad5e7111dbe69ee04d6f6b7d281cd7d964227db34289285aba9fecf591ed
MD5 ba2abf0cad8fdf8ac7daa139e2b3c199
BLAKE2b-256 128460dc6d82fdc0647a372d9b341bb132bb2bb4fe581058f631699c553de2b3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.0.6-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.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 482be10704298bce330242c60e6d2fff1acc38c880a8b2426bd3cc887b36be1c
MD5 7d650f2c9fe3b30c2723d57156c4ed1c
BLAKE2b-256 4a4d15c5cf32955bacf04769895ea8657e0f5a9c5722927a8c5902a9187cc5d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.0.6-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.6-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.6-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 fc3b69863ac54d2b0dfb886bb8f534c293b225fe9dcfbe445a51ef405bc951e6
MD5 96047cdc9481be3fcced814dc07acf8c
BLAKE2b-256 fd3a78c404d4dafa6df44c8e4ac2db7699e57d20abf804a75e8b011be1951fda

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.0.6-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a09a947c4aba771f711a005eedc9971fb37652a36eefd5685be1ffed5e43cd7c
MD5 0f8ad2c709a4466ef896a9607a311c18
BLAKE2b-256 19f94f5711717df8ea42eaf510d3fa88a3fdaf833f11277c71f46878f9c14ea6

See more details on using hashes here.

Provenance

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