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
- For user mode
pip install pygrnwang
- 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
- 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
)
- 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
Release files for pygrnwang 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pygrnwang-3.0.0.tar.gz | 1.0 MB | Details |
Built distributions (wheels)
Total release size: 51.4 MB
Release files / pygrnwang-3.0.0.tar.gz
| Download URL | pygrnwang-3.0.0.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b788f6bdf7c7b404f2578d80263c18cbedc486fd8676d1b79a958c0365e944e6
|
|
BLAKE2b-256 checksum How to use checksums |
397bb7a2cb36882948630a4e444b1e2c0e1f074634eb2070d53afe9c7956bbcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp314-cp314-win_amd64.whl
| Download URL | pygrnwang-3.0.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
06beba14010b5189fbf3e35c48b4e8218987bfbb2fd4caf08aadaac91db2b756
|
|
BLAKE2b-256 checksum How to use checksums |
030f4e2ead6e28dcf45235d16aabf4a47b7dd2e6e5d64b2e3e013689463a6507
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | pygrnwang-3.0.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
6dc119bcb431bf4e10e570ee2fa480e2b5ee79897ae943c44d4033260bf280d4
|
|
BLAKE2b-256 checksum How to use checksums |
af41a2d07e70fa5518c16fce52426e683763030011907774856bdfd430293d69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp314-cp314-macosx_26_0_arm64.whl
| Download URL | pygrnwang-3.0.0-cp314-cp314-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.14 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2e00623edb3368cc7c3d08634bb062275dc2393908d9546300cbad8a9621e56a
|
|
BLAKE2b-256 checksum How to use checksums |
2f8fd60897e0e6375d010e9ea352a8c28f7b10243d2cada068ee1e3a00dc3872
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp313-cp313-win_amd64.whl
| Download URL | pygrnwang-3.0.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
07a953ce7f41803943b93234a3f9e142760bd88f675527cba4c1e5054200aea0
|
|
BLAKE2b-256 checksum How to use checksums |
f9f9c385bc5daef57a13d5e209ef53715825f4cf254d427cf2cb531b90302346
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | pygrnwang-3.0.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
4d031042f7ac94f8bc966cb4495feb8594d65dd462f9d32e28d22b2e8c081dbd
|
|
BLAKE2b-256 checksum How to use checksums |
e662fccc993a35fb101629f9493d8bd5bc0ff73adb2aee608f5d7fcafe0b5cad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp313-cp313-macosx_26_0_arm64.whl
| Download URL | pygrnwang-3.0.0-cp313-cp313-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.13 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c46e97fabd75af8fe8c278c7dd91bceeef997f954eec698f0520cc68d38672c9
|
|
BLAKE2b-256 checksum How to use checksums |
2fba04776dbdc4a6bab827d306152f19ddd2c705dee75e41d52489b0320c1202
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp312-cp312-win_amd64.whl
| Download URL | pygrnwang-3.0.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7fa45834dfc421ddba81b3d54f7d93e3dfb021acfdb2463c84634004722a4996
|
|
BLAKE2b-256 checksum How to use checksums |
2349886e89fea21b62152c4756a784374785462337f5a6ea8a8a9788084efa63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | pygrnwang-3.0.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
6f85b692d8c11d142f67a70a49bb3968e2870f04fea7eb08d614b62474001db7
|
|
BLAKE2b-256 checksum How to use checksums |
b543a4304f9598789ed887d620d60420b4745f04d8a82a026814590611f0ad84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp312-cp312-macosx_26_0_arm64.whl
| Download URL | pygrnwang-3.0.0-cp312-cp312-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.12 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
927d140ee8b9b45b6c0da69e1d5da455f2129f4190a5d52c426f0cf3b91bdf15
|
|
BLAKE2b-256 checksum How to use checksums |
da6ee3aeb3dbd00ae69a61ee90076ed300c36e09f9c2e100cf861128f6a18dc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp311-cp311-win_amd64.whl
| Download URL | pygrnwang-3.0.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
536ddba1c2b7d8ef1a40ee7f23579e044c2c1e8c98e6e703f4af9764c6d7549f
|
|
BLAKE2b-256 checksum How to use checksums |
a7cc43ea5257fb17e95af2aa5954d8325acf643144c22fcf993bca2eb9d89572
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | pygrnwang-3.0.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
c847a64dc86fc303547f98862936fa39c86b73193c2aedf8e63027bee61c90a2
|
|
BLAKE2b-256 checksum How to use checksums |
2a5f55f99b219e100eb2b2dd8146da991dbc707849a6a2b2770bd7b4f5516a26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / pygrnwang-3.0.0-cp311-cp311-macosx_26_0_arm64.whl
| Download URL | pygrnwang-3.0.0-cp311-cp311-macosx_26_0_arm64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.11 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
667f04a74544f7e075ab4c32d26cd16338d881d830699d086caf2d53b704f34b
|
|
BLAKE2b-256 checksum How to use checksums |
309db43ba30a0179d09e2ef92f4b7a56be1f437be151a6abbb3be2e5670372b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log