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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 15.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

pygrnwang-2.1.3-cp310-cp310-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.10Windows x86-64

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

File metadata

  • Download URL: pygrnwang-2.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4c31dd21feb0b58d45b6d9923c64fef614723217aad8a8bac186a3b6b4476fa6
MD5 77e70088851f4c18fd0fc7b0c5d5e116
BLAKE2b-256 c45548eee7dd6c344f95670088af6594045ce59ed25d231aa138d798dbff9be4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.3-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.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 9e78a9c01bff598b890689698fff30e31a9fb5e2335a665995c206c4e43ac1f7
MD5 cfe21a5f7369efdcb9090a904d85c4a4
BLAKE2b-256 485aa255ad47b52614adda235b515fac94f2f771500e2cf88d31e5b20c2b1bae

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.3-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.3-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.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 da882e177db6aa3e67752dade1914c2ffd657491d554811543f1ec9209409d08
MD5 fd9eb268195529b919050d3ac1fa4727
BLAKE2b-256 c480536a77c1566e03490525c783e41f9ac2385069660c70624fdd4f09819419

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.3-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 32268c0649ad6c09b1b069cb2a17957924f871ce13d80904bca238914005e729
MD5 f36fadb8a4e6e74ed8f429c79d93bb36
BLAKE2b-256 76fb08b395807772de635bccd0242d99beb3b84d77b1583ca94e9f40673a8f56

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dde0eefe8bf8c19e08ba66e87e125972ebfa0cd9544ecde4e3646fc1fe09972d
MD5 e5f3996e4122afa93f37fbbe1e67e5d3
BLAKE2b-256 ee81556a75815cfcb4ab7d1d5aaa9327f741cc1cd7820670f7ad430e8a302dd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.3-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.3-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.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 9c2a92f0dc35292fde9552e5f97e6db4db9643a974d432460ae79facb5805df6
MD5 84682fc30d4891380719a2ccef960342
BLAKE2b-256 de4c7eb4c22de5d6d20b14642f45cf4aff85e5c6370cad0df3a2d55351b34b16

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 5074d67d66460b3e5f782689d573ab01b5f47361cb2d85ad07c21e13c6dca97e
MD5 5b7aa318d33b12b81b06656bbaf9f974
BLAKE2b-256 cc4d8b58b993a89079637ce1fe0bff79d66f708c8ee3497ea55f1922ebf557bd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e49c18573eb266853c2f674749c68ecad1ce55fcd5a6ed2c98e9f03dc2a5f8b5
MD5 a973a856e0b5f053f03046377555939f
BLAKE2b-256 495dc911aa17a63e8b99666906a547aea0eabeeb877b7fa8961764795e3a9ded

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.3-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.3-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.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8289b716705a351a6f31c921e1d4e90096f67a9824de949d98f20f57ddec4897
MD5 1e3257f1f6b1b6c90b9c7cb7028547d7
BLAKE2b-256 c0ea6f1c7d68236643ec8f58ca2d9108fe9a99e473b56d099a062c17ce8946f8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 57e451302fe25cb4aae0689cbbc6ad0bce2a6e387815675882c6a7bf7927d6b1
MD5 413f4d0bfa36bfd1cc1b8d8db95d07bf
BLAKE2b-256 3b6720561c5b9a11b5db32b8bfc31d3d886081557916936808c86c558ca99027

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b2322f1de33b96363d6c624fbbbb5928d8c29f6de3e23fe4022ea4686737c0a7
MD5 14d502332af30210f0f21956297a509e
BLAKE2b-256 bce39abfc813653ac3e2f57bbe12f57d839e100c24c7dc778c10308de174e41e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.3-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.3-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.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8281b73e17e4e3a6165f3e291f7629f51a0f87c1ebfdaa6a0a7512bf3c40dd43
MD5 11080c44032a58c2cbbbcaf471d882ee
BLAKE2b-256 6e9cc0db2bbb528edac0a7319ab1a8dc4b0f41c63ecc987590d1e5cafdbc7410

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.3-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d2e2971163ae4e16490c720589c4a50bc432c85a46d79f03b08ea4013b0e1880
MD5 02ae49db6aec4dc635ef8d1563cf689a
BLAKE2b-256 19432d8f4b6694895623c06a6d965cee92e973aacb6e310817a162f272377196

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.10, 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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4a77f07ca59fa13bb5287a4c53fb68c0a039443056c55dcd6586b3067f9167db
MD5 e4ff5e92f5fe5241887acea74f935751
BLAKE2b-256 eb5f0ebf40490e51384a05220d8e43594974b7dcd3599db1ac7a0171e4d930c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.3-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.3-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.3-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 5f51758c6842363cf1c5b23a73cde416ac61b1a7477be11b42e274d2eb2171fb
MD5 7903b44f059400eed873aeffecc50d8f
BLAKE2b-256 1636a479c61f7d59dfa82b39d681fc3ecefd3656457c00471bda7bf81cc22765

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.3-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9b8a515606de7cedf79e4fc871bfd61ee9333838b093fde2f9815fa130b99de7
MD5 eff44cbf7ca4e8cb42ffa595be0f9a40
BLAKE2b-256 227be790d485e9113574dbdb97bf30221af2657444d67716ce6ed8aa54b72ca7

See more details on using hashes here.

Provenance

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