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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 26.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 26.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 26.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

File metadata

  • Download URL: pygrnwang-2.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 8b5509f12788932fd6c74e8a52a5126475ac409bf0068b91eefacb325b0f5bad
MD5 b7b142aedaf5c9396e7c0daef92b3f73
BLAKE2b-256 1bff82673518fcbe590cec7f3350c2ff8c9e5e0944a15c4f880a23f1284f7b6d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.4-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.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 fa9f5ddc36c9e4ed30a286a162533a5b4bab6e68bb48ec91febb33a86773351c
MD5 fe02f31eba99b33dff81c3a455e1e4a2
BLAKE2b-256 ae8b310ad3dfc4397e11cb9bc5a0197866eb99ff31dd6a944989e12c7f131607

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.4-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.4-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.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 9078cfc7216d7f2afd9b1e42ab62ed07f7b2756f8c4702144bbed7b2498be056
MD5 5d5fe050ac03bf1c26c71105f4f073ce
BLAKE2b-256 6961eb90a8b613c511f7b186a666ebcc8435c43068684f89c8f7630e738f71f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.4-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 77980af70fb33694821a3fcdf91d78ff76eaa5add32bb2e1d2da7553aea2d684
MD5 7f6585a886f5ce302f167df8141a79e8
BLAKE2b-256 15eb25fe1e0726384d2e0ebbdfbc23738cef4de6edcdf190b053dd205c76b647

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.4-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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 188918e1e468b9cd1d6ce5d87ab905e8be18571b8de16a0738cb0e8aec02cc40
MD5 005bbeab9b6411dd0c81608546eb10cf
BLAKE2b-256 41604db3cfff703b4499056697baeeb56bcf65b5d7aaa3d31e97430b313b7ab6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.4-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.4-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.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 c5e46dca30e654ebbbe28b5d4b863b6673450fa5a0da1e1ad881d375471f66c2
MD5 68f1b81c95b09c69b6467a0da8768936
BLAKE2b-256 ad444ce8314062871080cf9e2b32422fc865d225fc435bf68a24a4cef869111c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.4-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 80a82d6e613ff94ecc6353b5d0e30991ff9abbeaef4a1554481268bf7e63fb37
MD5 3860d546f4313a0811318b80d2d43c3c
BLAKE2b-256 68a04e5f38227aa3694416560c18275354f5a8729614bfe2470eddd9d3aea649

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.4-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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 88d4f437d20c3b16c9bd84a8309e1baddd900ed67ba69e023af799f582dac09c
MD5 7756864b1d37d5c9f35b3fc695fe8d25
BLAKE2b-256 115ed6d2390f95dc32e4e95be97a3e4416d27073b56d49042581304c0a697588

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.4-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.4-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.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 70099d4f05efb813938dc8360455f8b2bc0fdd9e1952dcb7eae5d41962a4e72c
MD5 425b0b837405d777d139e7b1f37e79ca
BLAKE2b-256 86ea6a93816cfe7250606d77d27ec892db43878b32057ed433a3a9f172be54a2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.4-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 e868ba022d75d41689ff87470427298b44f41bebf3ebf37159f3ca2c5e5c86c2
MD5 6ac8469c096ce8dfb30a2e7e7734d9ce
BLAKE2b-256 4add7baeb6d51d7ecbe0f450652323eeabbfb438f1f7416b7643d24efec9c31f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygrnwang-2.1.4-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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 005b9c83f0fcddff66297905404a85da7cf61efad6a33ef89a150d3c90b6c59b
MD5 d3ee32b14b0a37f206178cb466402e28
BLAKE2b-256 a2e0c45c9dd1eb351227ad5481eed50ff5877caf00a7cba2b3b1473230a18a38

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygrnwang-2.1.4-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.4-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.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 6ecbeba0d0da105bf90a968017cf4e7fb997f29e4abe48aaf05019189deff57e
MD5 1ce1cbd43cafe89e8a9e51e836625282
BLAKE2b-256 732c2ddda80fbecf762d07a93b4146a06ec51ea3304f5aebe90d33ad9f9d73ae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygrnwang-2.1.4-cp311-cp311-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 776ed87e430527ec44298637b089737899a96a63ca434e0233b11281bee743ca
MD5 c7f6ae2b9bdc11d46c30845644179a24
BLAKE2b-256 f6c450f555c9da1942f230cb6665dc804710772a8a2bcccd1ccc907a981a5617

See more details on using hashes here.

Provenance

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