Skip to main content

A Python library for computing Green's function libaray.

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.5.tar.gz (1.0 MB 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.5-cp314-cp314-win_amd64.whl (4.0 MB view details)

Uploaded CPython 3.14Windows x86-64

pygrnwang-2.1.5-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.5-cp314-cp314-macosx_26_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

pygrnwang-2.1.5-cp313-cp313-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.13Windows x86-64

pygrnwang-2.1.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.1.5-cp313-cp313-macosx_26_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

pygrnwang-2.1.5-cp312-cp312-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.12Windows x86-64

pygrnwang-2.1.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.1.5-cp312-cp312-macosx_26_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

pygrnwang-2.1.5-cp311-cp311-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.11Windows x86-64

pygrnwang-2.1.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.1.5-cp311-cp311-macosx_26_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.11macOS 26.0+ ARM64

File details

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

File metadata

  • Download URL: pygrnwang-2.1.5.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrnwang-2.1.5.tar.gz
Algorithm Hash digest
SHA256 38834168f12d3c5c063dee2f5f5ad09031fcfa9980bd91dbbc81cb436daffae1
MD5 1131580eaeec7a7e38379ed94b8e2adb
BLAKE2b-256 58043335138e9d5f661235a66c718907d56d7f48178edb685aa724cb50980b04

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrnwang-2.1.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b957e4d327bdb0d23c4f675a522bd24709f511bb68ec14be52fa8e6b44ab05d4
MD5 66c65016c8acca2f4753c94f130d889e
BLAKE2b-256 e068c87253e17b4b14a86e09bece72ea1b68842efbbc75d202be1e3ea2119407

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.5-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.5-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.5-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a09f46866d42dfeeca3ce5204dd8d77688d4af2d89cc6c7ea14635557298192e
MD5 3607dc0ff6919d278b0240dced83f6ce
BLAKE2b-256 190e4df92b926b105b9e2e3c6e07a5ed441326b7123121df53a5da20067d1b13

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.5-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.5-cp314-cp314-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.1.5-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 f30c66d97bd03edadc7119cc56e20fa7d517c83c5de94a94c3c7d963dda3a934
MD5 ea6460d4d326f191c6440e6d29dde324
BLAKE2b-256 016d42e5377a242cff7031a8fd73a3d4702138997492ef39e04278a5a8c10c4f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrnwang-2.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 99edf9e11e4f578b3a5a923202cbf29a013f992ade0bbe4d30cb725e427c3eeb
MD5 ba163c660e2a71a5725551cd02390c47
BLAKE2b-256 9d1022fdfc3b3fdeee2ff1ea32490c8ef0c1f81b9c21fdddbb9ca9133483d3e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.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.1.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.1.5-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 a574782bc66aefccdb0eb9dad193856ef7b383f1ae87212096905a58b7fdf994
MD5 5977f8e42c6734ffd94839fb700b91df
BLAKE2b-256 814d4a8b4ddc0b3578d93f6cc9eb9e3a56976f84f97729c0ca80f5949f9d366e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.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.1.5-cp313-cp313-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.1.5-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 fbe0bd39f8ee2940c1bf25ccc78640da77b736898d13d3b9b0b95b920ce820e2
MD5 f370863a7a81ac56a4a309b2184dc0e8
BLAKE2b-256 90ca7c322344afcdf746ebb27e361607fe60aed68bb7db45f17be3804494e566

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrnwang-2.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e885dbb9f10eacf135b66587697ebb78eb2bf39588da10fcba1080c41fda2f7a
MD5 c67dc37a80fbfbde1023f40982339b9a
BLAKE2b-256 94a663a37432d0be177d6c0d42a44aea9330b156a7c80bf4c50abc30e8e41f5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.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.1.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.1.5-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 7c362d69d4461e64ecd6d4b36ed2fcd594dedcabb32bcc4c3a36ca43dcfc1387
MD5 0033121289f5415c9b3edc1abae964be
BLAKE2b-256 a5fd52f1efe105e2c4b3fedd53b496e4bccb5519efbaef237abb4fd004dd7f0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.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.1.5-cp312-cp312-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.1.5-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 644cda920683f591db5b2caa9715edde6c634920eecc0a43bfc0cbe24626bd3c
MD5 eb0c935b91cdf777ce9bce8a1a1fcd22
BLAKE2b-256 1dd3ea65108f54b1395d332922b3a430e3f7079e19fd78b68a513412b989fd43

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygrnwang-2.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b96022cb95061ac11c45aa5222a1b174bf1e51b42749845792e6151821bf8b3d
MD5 7671ae68cdf53a1a6c752a76dfd05402
BLAKE2b-256 eb04adbb1338f24c54fd78f947ef1138f517f4e91aae562855958d95b80f042e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.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.1.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.1.5-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 80fcec4c5e1f46d8416635d1f20ff063b81d3caa1ce24ddea52cb3e2a27120f2
MD5 f6ed275fc5488a77667e752620411538
BLAKE2b-256 cd8e571f970343701cae78a80c620d6fa0b50b2ca86d0a5b8ff770aa89df3be2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.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.1.5-cp311-cp311-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for pygrnwang-2.1.5-cp311-cp311-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 d941674f9776a0c009668cc583525adef9f445d090e5f8f23491867a449e457d
MD5 7c4b285dee9f50e56e53bd8216b27061
BLAKE2b-256 54b935609ac042ee6c284b5f7772a433a2ab03f5acc7ca721b841f47a25dd96d

See more details on using hashes here.

Provenance

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