dyncfs 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. dyncfs-1.0.0/LICENSE +21 -0
  2. dyncfs-1.0.0/MANIFEST.in +5 -0
  3. dyncfs-1.0.0/PKG-INFO +146 -0
  4. dyncfs-1.0.0/README.md +104 -0
  5. dyncfs-1.0.0/dyncfs/__init__.py +8 -0
  6. dyncfs-1.0.0/dyncfs/cfs_dynamic.py +1610 -0
  7. dyncfs-1.0.0/dyncfs/cfs_dynamic_backup.py +1328 -0
  8. dyncfs-1.0.0/dyncfs/cfs_static.py +760 -0
  9. dyncfs-1.0.0/dyncfs/configuration.py +511 -0
  10. dyncfs-1.0.0/dyncfs/convert_input_format.py +316 -0
  11. dyncfs-1.0.0/dyncfs/create_edcmp.py +117 -0
  12. dyncfs-1.0.0/dyncfs/create_edcmp_bulk.py +227 -0
  13. dyncfs-1.0.0/dyncfs/create_edgrn.py +96 -0
  14. dyncfs-1.0.0/dyncfs/create_edgrn_bulk.py +147 -0
  15. dyncfs-1.0.0/dyncfs/create_nd_by_crust1_ak135.py +121 -0
  16. dyncfs-1.0.0/dyncfs/create_qseis2025.py +234 -0
  17. dyncfs-1.0.0/dyncfs/create_qseis2025_bulk.py +258 -0
  18. dyncfs-1.0.0/dyncfs/create_qssp2020.py +282 -0
  19. dyncfs-1.0.0/dyncfs/create_qssp2020_bulk.py +535 -0
  20. dyncfs-1.0.0/dyncfs/crust1.py +132 -0
  21. dyncfs-1.0.0/dyncfs/dyncfs.egg-info/PKG-INFO +146 -0
  22. dyncfs-1.0.0/dyncfs/dyncfs.egg-info/SOURCES.txt +164 -0
  23. dyncfs-1.0.0/dyncfs/dyncfs.egg-info/dependency_links.txt +1 -0
  24. dyncfs-1.0.0/dyncfs/dyncfs.egg-info/requires.txt +6 -0
  25. dyncfs-1.0.0/dyncfs/dyncfs.egg-info/top_level.txt +1 -0
  26. dyncfs-1.0.0/dyncfs/edcmp2inp.py +132 -0
  27. dyncfs-1.0.0/dyncfs/edgrn2inp.py +91 -0
  28. dyncfs-1.0.0/dyncfs/exec/TauP-2.6.1.jar +0 -0
  29. dyncfs-1.0.0/dyncfs/focal_mechanism.py +360 -0
  30. dyncfs-1.0.0/dyncfs/geo.py +397 -0
  31. dyncfs-1.0.0/dyncfs/main.py +115 -0
  32. dyncfs-1.0.0/dyncfs/obspy_geo.py +310 -0
  33. dyncfs-1.0.0/dyncfs/plot_cfs_dynamic_2d.py +369 -0
  34. dyncfs-1.0.0/dyncfs/plot_cfs_dynamic_3d.py +179 -0
  35. dyncfs-1.0.0/dyncfs/plot_cfs_static_2d.py +220 -0
  36. dyncfs-1.0.0/dyncfs/plot_cfs_static_3d.py +172 -0
  37. dyncfs-1.0.0/dyncfs/plot_gif.py +21 -0
  38. dyncfs-1.0.0/dyncfs/plot_slip_2d.py +254 -0
  39. dyncfs-1.0.0/dyncfs/plot_slip_3d.py +176 -0
  40. dyncfs-1.0.0/dyncfs/pytaup.py +153 -0
  41. dyncfs-1.0.0/dyncfs/qseis2025inp.py +280 -0
  42. dyncfs-1.0.0/dyncfs/qssp2020inp.py +166 -0
  43. dyncfs-1.0.0/dyncfs/read_edcmp.py +140 -0
  44. dyncfs-1.0.0/dyncfs/read_qseis2025.py +352 -0
  45. dyncfs-1.0.0/dyncfs/read_qssp2020.py +354 -0
  46. dyncfs-1.0.0/dyncfs/signal_process.py +146 -0
  47. dyncfs-1.0.0/dyncfs/utils.py +440 -0
  48. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/dc3d.f +665 -0
  49. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/dc3d0.f +460 -0
  50. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/edcdisc.f +188 -0
  51. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/edcglobal.h +15 -0
  52. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/edcgrn.f +447 -0
  53. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/edcmain.f +327 -0
  54. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/edcoutput.f +134 -0
  55. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/getdata.f +30 -0
  56. dyncfs-1.0.0/fortran_src_codes/edcmp2.0_src/okada.f +189 -0
  57. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/axb.f +26 -0
  58. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/bessj.f +58 -0
  59. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/bessj0.f +42 -0
  60. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/bessj1.f +42 -0
  61. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgbstab.f +60 -0
  62. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgglobal.h +25 -0
  63. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edghask.f +79 -0
  64. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgkern.f +36 -0
  65. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edglayer.f +77 -0
  66. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgmain.f +299 -0
  67. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgmatinv.f +55 -0
  68. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgmatrix.f +48 -0
  69. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgmoment.f +97 -0
  70. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgpsv.f +321 -0
  71. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgsh.f +208 -0
  72. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgsublay.f +78 -0
  73. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/edgwvint.f +334 -0
  74. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/gemp.f +83 -0
  75. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/getdata.f +26 -0
  76. dyncfs-1.0.0/fortran_src_codes/edgrn2.0_src/memcpy.f +17 -0
  77. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/bessj.f +54 -0
  78. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/bessj0.f +33 -0
  79. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/bessj1.f +33 -0
  80. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/caxcb.f +20 -0
  81. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/cdgemp.f +81 -0
  82. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/cmemcpy.f +15 -0
  83. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/four1.f +65 -0
  84. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/getdata.f +26 -0
  85. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsam2ve.f +61 -0
  86. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsbsj.f +36 -0
  87. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsfftinv.f +138 -0
  88. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsgetinp.f +843 -0
  89. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsglobal.h +192 -0
  90. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qshksh.f +51 -0
  91. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qskern.f +33 -0
  92. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qslayer.f +128 -0
  93. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsmain.f +78 -0
  94. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsmatrix0.f +86 -0
  95. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsmultis.f +136 -0
  96. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qspsv.f +610 -0
  97. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsqmodel.f +61 -0
  98. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qssh.f +240 -0
  99. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qssource.f +69 -0
  100. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qssublay.f +142 -0
  101. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qsve2am.f +75 -0
  102. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qswavelet.f +60 -0
  103. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qswaveno.f +37 -0
  104. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/qswvint.f +422 -0
  105. dyncfs-1.0.0/fortran_src_codes/qseis2025_src/taper.f +25 -0
  106. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/banddpasss.f +44 -0
  107. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/brunewvlet.f +22 -0
  108. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/butterworth.f +37 -0
  109. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/caxcb.f +20 -0
  110. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/cdsvd500.f +107 -0
  111. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/cmemcpy.f +15 -0
  112. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/disazi.f +73 -0
  113. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/four1w.f +77 -0
  114. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/fsimpson.f +34 -0
  115. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/legendre.f +28 -0
  116. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/moments.f +41 -0
  117. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpalloc.f +119 -0
  118. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpdifmat0.f +91 -0
  119. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpdifmatl.f +116 -0
  120. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpdifmats.f +96 -0
  121. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpfftinv.f +240 -0
  122. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpgetinp.f +686 -0
  123. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpgrnspec.f +752 -0
  124. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qplegendre.f +28 -0
  125. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpmain.f +78 -0
  126. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qppsvkern.f +257 -0
  127. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qppsvkerng.f +124 -0
  128. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpqmodel.f +68 -0
  129. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpshkern.f +90 -0
  130. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpsmat.f +284 -0
  131. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpsmat0.f +124 -0
  132. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpsmatc.f +142 -0
  133. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpsprop.f +1602 -0
  134. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpsprop0.f +229 -0
  135. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpspropg.f +2037 -0
  136. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpspropg0.f +212 -0
  137. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart0.f +40 -0
  138. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart0a.f +46 -0
  139. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart0g.f +28 -0
  140. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart2t.f +36 -0
  141. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart4.f +88 -0
  142. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart4a.f +65 -0
  143. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart4g.f +51 -0
  144. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart6.f +123 -0
  145. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart6a.f +103 -0
  146. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpstart6g.f +29 -0
  147. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpsublayer.f +714 -0
  148. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qptmat.f +99 -0
  149. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qptprop.f +196 -0
  150. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/qpwvint.f +1112 -0
  151. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/ruku.f +108 -0
  152. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/skipdoc.f +20 -0
  153. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/spbdphj.f +48 -0
  154. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/spbdphy.f +48 -0
  155. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/spbh12.f +41 -0
  156. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/spbjh.f +162 -0
  157. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/spbphj.f +44 -0
  158. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/spbphy.f +44 -0
  159. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/spbpsj.f +44 -0
  160. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/spbpsy.f +44 -0
  161. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/swavelet.f +31 -0
  162. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/taper.f +31 -0
  163. dyncfs-1.0.0/fortran_src_codes/qssp2020_src/transfs2t.f +143 -0
  164. dyncfs-1.0.0/pyproject.toml +25 -0
  165. dyncfs-1.0.0/setup.cfg +4 -0
  166. dyncfs-1.0.0/setup.py +82 -0
dyncfs-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Zhou Jiangcheng
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include fortran_src_codes *.f, *.h
4
+ recursive-include dyncfs/exec *.jar
5
+ recursive-include dyncfs *.py
dyncfs-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.4
2
+ Name: dyncfs
3
+ Version: 1.0.0
4
+ Summary: A Python library for computing Coulomb Failure Stress Change.
5
+ Home-page: https://github.com/Zhou-Jiangcheng/dyncfs
6
+ Author: Zhou Jiangcheng
7
+ Author-email: Zhou Jiangcheng <zhoujcpku@outlook.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2024 Zhou Jiangcheng
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ Requires-Python: >=3.11
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Requires-Dist: numpy>=2.3.3
33
+ Requires-Dist: matplotlib>=3.9.2
34
+ Requires-Dist: scipy>=1.16.2
35
+ Requires-Dist: pandas>=2.2.3
36
+ Requires-Dist: jpype1>=1.5.2
37
+ Requires-Dist: tqdm>=4.67.1
38
+ Dynamic: author
39
+ Dynamic: home-page
40
+ Dynamic: license-file
41
+ Dynamic: requires-python
42
+
43
+ # Introduction
44
+
45
+ This Python package serves as the frontend for calculating and building a Green's function library for synthetic seismograms and then compute the static/dynamic Coulomb Failure Stress Change. The backend consists of Wang Rongjiang's program for calculating synthetic seismograms, including EDGRN/EDCMP, [QSEIS_2006_STRESS](https://github.com/Zhou-Jiangcheng/QSEIS_2006_STRESS) and QSSP. Traveling time is calculated using [TAUP](https://github.com/crotwell/TauP). Some geographic coordinate transformations use code from [obspy](https://github.com/obspy/obspy).
46
+
47
+ References:
48
+ 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](https://doi.org/10.1785/BSSA0890030733)
49
+
50
+ 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
51
+
52
+ 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
53
+
54
+ 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
55
+
56
+ # Installation
57
+
58
+ 1. Install the requirments by conda (conda 24.11.3)
59
+
60
+ ```
61
+ conda create -n cfs python=3.11
62
+ conda activate cfs
63
+ conda install openjdk jpype1 gfortran numpy scipy pandas matplotlib tqdm -c conda-forge
64
+ conda install geographiclib mpi4py -c conda-forge # optional
65
+ ```
66
+
67
+ or install the requirments using system package manager, such as apt (Debian 12)
68
+
69
+ ```
70
+ sudo apt install openjdk gfortran
71
+ sudo apt install openmpi-common # optional
72
+ ```
73
+
74
+ 2. Download this reposity and install by pip.
75
+
76
+ ```
77
+ git clone https://github.com/Zhou-Jiangcheng/dyncfs.git
78
+ cd dyncfs
79
+ pip install .
80
+ ```
81
+
82
+ For code modification and debugging, use editable mode:
83
+
84
+ ```
85
+ pip install -e .
86
+ ```
87
+
88
+ or install from pypi
89
+
90
+ ```
91
+ pip install dyncfs
92
+ ```
93
+
94
+ # Usage
95
+
96
+ Fill in all parameters in the .ini file, and prepare the input files as described in `example.ini`, including `source_plane[m].csv` and `obs_plane[n].csv` under the input directory, as well as `model.nd` representing the Earth model.
97
+
98
+ 1. Command-line usage
99
+
100
+ ```
101
+ dyncfs --help
102
+ ```
103
+
104
+ ```
105
+ usage: dyncfs [-h] --config CONFIG [--create-static-lib] [--compute-static-cfs] [--compute-static-cfs-fix-depth] [--run-static] [--create-dynamic-lib] [--compute-dynamic-cfs] [--compute-dynamic-cfs-fix-depth] [--run-dynamic] [--run-all]
106
+
107
+ dyncfs command line tool
108
+
109
+ options:
110
+ -h, --help show this help message and exit
111
+ --config CONFIG Path to the configuration file
112
+ --create-static-lib Create static stress library
113
+ --compute-static-cfs Compute static dCFS on obs faults
114
+ --compute-static-cfs-fix-depth
115
+ Compute static dCFS at fixed depth
116
+ --run-static Create static stress library and Compute static dCFS on obs faults and Compute static dCFS at fixed depth
117
+ --create-dynamic-lib Create dynamic stress library
118
+ --compute-dynamic-cfs
119
+ Compute dynamic dCFS on obs faults
120
+ --compute-dynamic-cfs-fix-depth
121
+ Compute dynamic dCFS at fixed depth
122
+ --run-dynamic Create dynamic stress library and Compute dynamic dCFS on obs faults and Compute dynamic dCFS at fixed depth
123
+ --run-all Create static and dynamic stress library and Compute static and dynamic dCFS
124
+ ```
125
+
126
+ 2. Import and use classes and functions in .py files
127
+
128
+ ```
129
+ from dyncfs.cfs_static import *
130
+
131
+ if __name__ == "__main__":
132
+ config = CfsConfig()
133
+ config.read_config("example.ini")
134
+ create_static_lib(config)
135
+ compute_static_cfs_parallel(config)
136
+ ```
137
+
138
+ ```
139
+ from dyncfs.cfs_dynamic import *
140
+
141
+ if __name__ == "__main__":
142
+ config = CfsConfig()
143
+ config.read_config("example.ini")
144
+ create_dynamic_lib(config)
145
+ compute_dynamic_cfs_parallel(config)
146
+ ```
dyncfs-1.0.0/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # Introduction
2
+
3
+ This Python package serves as the frontend for calculating and building a Green's function library for synthetic seismograms and then compute the static/dynamic Coulomb Failure Stress Change. The backend consists of Wang Rongjiang's program for calculating synthetic seismograms, including EDGRN/EDCMP, [QSEIS_2006_STRESS](https://github.com/Zhou-Jiangcheng/QSEIS_2006_STRESS) and QSSP. Traveling time is calculated using [TAUP](https://github.com/crotwell/TauP). Some geographic coordinate transformations use code from [obspy](https://github.com/obspy/obspy).
4
+
5
+ References:
6
+ 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](https://doi.org/10.1785/BSSA0890030733)
7
+
8
+ 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
9
+
10
+ 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
11
+
12
+ 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
13
+
14
+ # Installation
15
+
16
+ 1. Install the requirments by conda (conda 24.11.3)
17
+
18
+ ```
19
+ conda create -n cfs python=3.11
20
+ conda activate cfs
21
+ conda install openjdk jpype1 gfortran numpy scipy pandas matplotlib tqdm -c conda-forge
22
+ conda install geographiclib mpi4py -c conda-forge # optional
23
+ ```
24
+
25
+ or install the requirments using system package manager, such as apt (Debian 12)
26
+
27
+ ```
28
+ sudo apt install openjdk gfortran
29
+ sudo apt install openmpi-common # optional
30
+ ```
31
+
32
+ 2. Download this reposity and install by pip.
33
+
34
+ ```
35
+ git clone https://github.com/Zhou-Jiangcheng/dyncfs.git
36
+ cd dyncfs
37
+ pip install .
38
+ ```
39
+
40
+ For code modification and debugging, use editable mode:
41
+
42
+ ```
43
+ pip install -e .
44
+ ```
45
+
46
+ or install from pypi
47
+
48
+ ```
49
+ pip install dyncfs
50
+ ```
51
+
52
+ # Usage
53
+
54
+ Fill in all parameters in the .ini file, and prepare the input files as described in `example.ini`, including `source_plane[m].csv` and `obs_plane[n].csv` under the input directory, as well as `model.nd` representing the Earth model.
55
+
56
+ 1. Command-line usage
57
+
58
+ ```
59
+ dyncfs --help
60
+ ```
61
+
62
+ ```
63
+ usage: dyncfs [-h] --config CONFIG [--create-static-lib] [--compute-static-cfs] [--compute-static-cfs-fix-depth] [--run-static] [--create-dynamic-lib] [--compute-dynamic-cfs] [--compute-dynamic-cfs-fix-depth] [--run-dynamic] [--run-all]
64
+
65
+ dyncfs command line tool
66
+
67
+ options:
68
+ -h, --help show this help message and exit
69
+ --config CONFIG Path to the configuration file
70
+ --create-static-lib Create static stress library
71
+ --compute-static-cfs Compute static dCFS on obs faults
72
+ --compute-static-cfs-fix-depth
73
+ Compute static dCFS at fixed depth
74
+ --run-static Create static stress library and Compute static dCFS on obs faults and Compute static dCFS at fixed depth
75
+ --create-dynamic-lib Create dynamic stress library
76
+ --compute-dynamic-cfs
77
+ Compute dynamic dCFS on obs faults
78
+ --compute-dynamic-cfs-fix-depth
79
+ Compute dynamic dCFS at fixed depth
80
+ --run-dynamic Create dynamic stress library and Compute dynamic dCFS on obs faults and Compute dynamic dCFS at fixed depth
81
+ --run-all Create static and dynamic stress library and Compute static and dynamic dCFS
82
+ ```
83
+
84
+ 2. Import and use classes and functions in .py files
85
+
86
+ ```
87
+ from dyncfs.cfs_static import *
88
+
89
+ if __name__ == "__main__":
90
+ config = CfsConfig()
91
+ config.read_config("example.ini")
92
+ create_static_lib(config)
93
+ compute_static_cfs_parallel(config)
94
+ ```
95
+
96
+ ```
97
+ from dyncfs.cfs_dynamic import *
98
+
99
+ if __name__ == "__main__":
100
+ config = CfsConfig()
101
+ config.read_config("example.ini")
102
+ create_dynamic_lib(config)
103
+ compute_dynamic_cfs_parallel(config)
104
+ ```
@@ -0,0 +1,8 @@
1
+ """
2
+ dyncfs
3
+ ==========
4
+ A Python library for computing Coulomb Failure Stress Change in the layered Earth model.
5
+
6
+ """
7
+
8
+ __version__ = "1.0.0"