From b94105874f1d78a538601b550ce9fa0c4a432767 Mon Sep 17 00:00:00 2001 From: Dengda98 Date: Mon, 5 May 2025 22:54:18 +0800 Subject: [PATCH] DOC: add SAFIM --- .../API/C_extension/common/const.po | 6 +- .../API/C_extension/common/safim.po | 37 +++ .../en/LC_MESSAGES/API/pygrt/c_interfaces.po | 10 +- .../locales/en/LC_MESSAGES/API/pygrt/pymod.po | 32 ++- .../Advanced/filon/linear_filon.po | 221 ++++++++++++++++++ .../Advanced/filon/self_adaptive_filon.po | 146 ++++++++++++ .../en/LC_MESSAGES/Advanced/filon_linear.po | 187 --------------- docs/locales/en/LC_MESSAGES/index.po | 90 +++---- .../linear_filon.rst} | 11 +- docs/source/Advanced/filon/run/milrow | 9 + docs/source/Advanced/filon/run/plot.py | 33 +++ docs/source/Advanced/filon/run/run.py | 16 ++ docs/source/Advanced/filon/run/run.sh | 10 + .../Advanced/filon/self_adaptive_filon.rst | 68 ++++++ docs/source/Advanced/index.rst | 3 +- docs/source/index.rst | 5 +- docs/source/run_all.sh | 8 + 17 files changed, 645 insertions(+), 247 deletions(-) create mode 100644 docs/locales/en/LC_MESSAGES/API/C_extension/common/safim.po create mode 100644 docs/locales/en/LC_MESSAGES/Advanced/filon/linear_filon.po create mode 100644 docs/locales/en/LC_MESSAGES/Advanced/filon/self_adaptive_filon.po delete mode 100644 docs/locales/en/LC_MESSAGES/Advanced/filon_linear.po rename docs/source/Advanced/{filon_linear.rst => filon/linear_filon.rst} (90%) create mode 100644 docs/source/Advanced/filon/run/milrow create mode 100644 docs/source/Advanced/filon/run/plot.py create mode 100644 docs/source/Advanced/filon/run/run.py create mode 100755 docs/source/Advanced/filon/run/run.sh create mode 100644 docs/source/Advanced/filon/self_adaptive_filon.rst diff --git a/docs/locales/en/LC_MESSAGES/API/C_extension/common/const.po b/docs/locales/en/LC_MESSAGES/API/C_extension/common/const.po index 5101c73e..9bcd9b64 100644 --- a/docs/locales/en/LC_MESSAGES/API/C_extension/common/const.po +++ b/docs/locales/en/LC_MESSAGES/API/C_extension/common/const.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PyGRT 0.7.1.dev5+g2230cdc.d20250427\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-27 12:43+0800\n" +"POT-Creation-Date: 2025-05-05 22:22+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -31,6 +31,10 @@ msgstr "" msgid "Typedefs" msgstr "" +#: ../../source/API/C_extension/common/const.rst +msgid "Enums" +msgstr "" + #: ../../source/API/C_extension/common/const.rst msgid "Variables" msgstr "" diff --git a/docs/locales/en/LC_MESSAGES/API/C_extension/common/safim.po b/docs/locales/en/LC_MESSAGES/API/C_extension/common/safim.po new file mode 100644 index 00000000..1864b957 --- /dev/null +++ b/docs/locales/en/LC_MESSAGES/API/C_extension/common/safim.po @@ -0,0 +1,37 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2025, Zhu Dengda +# This file is distributed under the same license as the PyGRT package. +# FIRST AUTHOR , 2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PyGRT 0.7.1.dev29+g6f42373.d20250505\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-05 22:22+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" + +#: ../../source/API/C_extension/common/safim.rst:2 +msgid "safim.h" +msgstr "" + +#: ../../source/API/C_extension/common/safim.rst +msgid "Functions" +msgstr "" + +#: ../../source/API/C_extension/common/safim.rst +msgid "参数" +msgstr "" + +#: ../../source/API/C_extension/common/safim.rst +msgid "返回" +msgstr "" + diff --git a/docs/locales/en/LC_MESSAGES/API/pygrt/c_interfaces.po b/docs/locales/en/LC_MESSAGES/API/pygrt/c_interfaces.po index 6f784423..b8329d7b 100644 --- a/docs/locales/en/LC_MESSAGES/API/pygrt/c_interfaces.po +++ b/docs/locales/en/LC_MESSAGES/API/pygrt/c_interfaces.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PyGRT 0.7.1.dev5+g2230cdc.d20250427\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-27 12:43+0800\n" +"POT-Creation-Date: 2025-05-05 22:22+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -83,6 +83,14 @@ msgstr "" msgid "计算1D层状半空间的初至波走时" msgstr "" +#: ../../docstring of pygrt.c_interfaces.C_read_pymod_from_file:1 +msgid "读取模型文件并进行预处理" +msgstr "" + +#: ../../docstring of pygrt.c_interfaces.C_free_pymod:1 +msgid "释放C程序中申请的PYMODEL1D结构体内存" +msgstr "" + #: ../../docstring of pygrt.c_interfaces.C_free:1 msgid "释放在C中申请的内存" msgstr "" diff --git a/docs/locales/en/LC_MESSAGES/API/pygrt/pymod.po b/docs/locales/en/LC_MESSAGES/API/pygrt/pymod.po index 65541551..b16afb11 100644 --- a/docs/locales/en/LC_MESSAGES/API/pygrt/pymod.po +++ b/docs/locales/en/LC_MESSAGES/API/pygrt/pymod.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PyGRT 0.7.1.dev5+g2230cdc.d20250427\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-27 12:43+0800\n" +"POT-Creation-Date: 2025-05-05 22:22+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -162,38 +162,48 @@ msgstr "" #: of pygrt.pymod.PyModel1D.compute_grn:19 #: pygrt.pymod.PyModel1D.compute_static_grn:11 -msgid "Filon积分的间隔 filonLength, 和波数积分和Filon积分的分割点filonCut, k*=/rmax" +msgid "Filon积分的间隔" msgstr "" #: of pygrt.pymod.PyModel1D.compute_grn:20 #: pygrt.pymod.PyModel1D.compute_static_grn:12 -msgid "是否计算位移u的空间导数" +msgid "自适应Filon积分采样精度" msgstr "" #: of pygrt.pymod.PyModel1D.compute_grn:21 -msgid "待计算的震源类型" +#: pygrt.pymod.PyModel1D.compute_static_grn:13 +msgid "波数积分和Filon积分的分割点filonCut, k*=/rmax" msgstr "" #: of pygrt.pymod.PyModel1D.compute_grn:22 -#: pygrt.pymod.PyModel1D.compute_static_grn:13 +#: pygrt.pymod.PyModel1D.compute_static_grn:14 +msgid "是否计算位移u的空间导数" +msgstr "" + +#: of pygrt.pymod.PyModel1D.compute_grn:23 +msgid "待计算的震源类型" +msgstr "" + +#: of pygrt.pymod.PyModel1D.compute_grn:24 +#: pygrt.pymod.PyModel1D.compute_static_grn:15 msgid "" "波数k积分(包括Filon积分和峰谷平均法)的过程记录文件,常用于debug或者观察积分过程中 :math:`F(k,\\omega)` 和 " ":math:`F(k,\\omega)J_m(kr)k` 的变化" msgstr "" -#: of pygrt.pymod.PyModel1D.compute_grn:23 +#: of pygrt.pymod.PyModel1D.compute_grn:25 msgid "仅输出特定频点的过程记录文件,建议给定频点,否则默认所有频率点的记录文件都输出,很占空间" msgstr "" -#: of pygrt.pymod.PyModel1D.compute_grn:24 +#: of pygrt.pymod.PyModel1D.compute_grn:26 msgid "是否打印运行时间" msgstr "" -#: of pygrt.pymod.PyModel1D.compute_grn:26 +#: of pygrt.pymod.PyModel1D.compute_grn:28 msgid "- **dataLst** - 列表,每个元素为 :class:`obspy.Stream` 类型 )" msgstr "" -#: of pygrt.pymod.PyModel1D.compute_grn:27 +#: of pygrt.pymod.PyModel1D.compute_grn:29 msgid "**dataLst** - 列表,每个元素为 :class:`obspy.Stream` 类型 )" msgstr "" @@ -223,11 +233,11 @@ msgstr "" msgid "定义波数k积分的间隔 `dk=2\\pi / (L*rmax)`, 默认15;负数表示使用Filon积分" msgstr "" -#: of pygrt.pymod.PyModel1D.compute_static_grn:15 +#: of pygrt.pymod.PyModel1D.compute_static_grn:17 msgid "- **dataDct** - 字典形式的格林函数" msgstr "" -#: of pygrt.pymod.PyModel1D.compute_static_grn:16 +#: of pygrt.pymod.PyModel1D.compute_static_grn:18 msgid "**dataDct** - 字典形式的格林函数" msgstr "" diff --git a/docs/locales/en/LC_MESSAGES/Advanced/filon/linear_filon.po b/docs/locales/en/LC_MESSAGES/Advanced/filon/linear_filon.po new file mode 100644 index 00000000..6d9b7621 --- /dev/null +++ b/docs/locales/en/LC_MESSAGES/Advanced/filon/linear_filon.po @@ -0,0 +1,221 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2025, Zhu Dengda +# This file is distributed under the same license as the PyGRT package. +# FIRST AUTHOR , 2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PyGRT 0.6.1.dev17+g4521452.d20250424\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-05 22:22+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" + +#: ../../source/Advanced/filon/linear_filon.rst:4 +msgid "固定间隔的Filon积分法" +msgstr "Fixed-Interval Filon's Integration Method" + +#: ../../source/Advanced/filon/linear_filon.rst +msgid "Author" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:6 +msgid "Zhu Dengda" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst +msgid "Email" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:7 +msgid "zhudengda@mail.iggcas.ac.cn" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:13 +msgid "" +"谨慎使用固定间隔的Filon积分法,除非你很清楚原理以及误差来源。推荐使用 :ref:`self_adaptive_filon` " +"以减少固定积分间隔的影响。" +msgstr "" +"Use the fixed-interval Filon integration method with caution unless you " +"fully understand its principles and sources of error. It is recommended " +"to use :ref:`self_adaptive_filon` to reduce the impact of fixed " +"integration intervals." + +#: ../../source/Advanced/filon/linear_filon.rst:16 +msgid "" +"以下介绍程序中使用的 **基于两点线性插值的Filon积分** :ref:`(纪晨, 姚振兴, 1995) ` " +":ref:`(初稿) ` ,主要介绍思路,具体公式推导详见对应论文。" +msgstr "" +"The following introduces the **Filon's Integration based on two-point " +"linear interpolation** :ref:`(Ji Chen, Yao Zhenxing, 1995) `" +" :ref:`(初稿) ` used in the program, mainly " +"explaining the idea. For detailed formula derivations, refer to the " +"corresponding paper." + +#: ../../source/Advanced/filon/linear_filon.rst:18 +msgid "对于以下积分," +msgstr "For the following integral," + +#: ../../source/Advanced/filon/linear_filon.rst:20 +msgid "P_m(\\omega,r) = \\int_0^{k_{\\text{max}}} F_m(k, \\omega)J_m(kr)kdk" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:24 +msgid "分成两个部分," +msgstr "It is divided into two parts," + +#: ../../source/Advanced/filon/linear_filon.rst:26 +msgid "" +"P_m(\\omega,r) = \\int_0^{k^*} F_m(k, \\omega)J_m(kr)kdk + " +"\\int_{k^*}^{k_{\\text{max}}} F_m(k, \\omega)J_m(kr)kdk" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:30 +msgid "" +"其中积分第一部分仍然使用离散波数积分求解 (见 :ref:`k_integ_rst` " +"部分),积分第二部分将Bessel函数取渐近表达式,可将其转为以下形式" +msgstr "" +"The first part of the integral still uses discrete wavenumber integration" +" to solve (see :ref:`k_integ_rst` section), and the second part of the " +"integral takes the asymptotic expression of the Bessel function, which " +"can be transformed into the following form." + +#: ../../source/Advanced/filon/linear_filon.rst:32 +msgid "" +"\\begin{align}\n" +"P_m(\\omega,r) &= \\sqrt{\\dfrac{2}{\\pi r}}\n" +"\\bbox[yellow] {\\int_{k^*}^{k_{\\text{max}}} \\bar{F}_m(k, \\omega) " +"\\text{cos} \\left( kr - (2m+1)\\pi/4 \\right) dk } \\\\\n" +"\\bar{F}_m(k, \\omega) &= \\sqrt{k} F_m(k, \\omega)\n" +"\\end{align}" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:40 +msgid "" +"其中高亮部分的积分是Filon积分的关键。在每一个区间 :math:`[k_i, k_{i+1}], k_i=(i-1) \\Delta k` " +"内,使用两点线性插值公式,:math:`\\bar{F}` 可表示为" +msgstr "" +"The highlighted part of the integral is the key to Filon's integration. " +"In each interval :math:`[k_i, k_{i+1}], k_i=(i-1) \\Delta k`, using the " +"two-point linear interpolation formula, :math:`\\bar{F}` can be expressed" +" as" + +#: ../../source/Advanced/filon/linear_filon.rst:42 +msgid "" +"\\bar{F} = \\bar{F}_i + \\dfrac{\\bar{F}_{i+1} - \\bar{F}_i}{\\Delta k} " +"(k - k_i)" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:46 +msgid "" +"将此式代回积分公式中,可得到 " +"**该区间内的积分解析解**,而最终的解即为多个区间内解析解的和。可进一步推导,将相邻区间的解析解中的部分式子两两相消,得到更简化的整个区间的解析解。由于相比于Bessel函数," +" :math:`\\bar{F}` 往往变化比较缓慢,故Filon积分可使用相对较大的步长 :math:`\\Delta k` " +"也可以有很好的精度。" +msgstr "" +"Substituting this formula back into the integral formula yields **the " +"analytical solution of the integral within the interval**, and the final " +"solution is the sum of the analytical solutions within multiple " +"intervals. Further derivation can simplify the analytical solution for " +"the entire interval by canceling out parts of the formulas in adjacent " +"intervals. Since :math:`\\bar{F}` often changes more slowly compared to " +"the Bessel function, Filon's integration can achieve good accuracy even " +"with relatively large step sizes :math:`\\Delta k`." + +#: ../../source/Advanced/filon/linear_filon.rst:52 +msgid "从以上推导可看出,该方法的精度取决于以下两个方面:" +msgstr "" +"From the above derivation, it can be seen that the accuracy of this " +"method depends on the following two aspects:" + +#: ../../source/Advanced/filon/linear_filon.rst:54 +msgid "**Bessel函数渐近表达式与真实值的误差:** 通过将积分分为两个部分计算,可大幅减少该误差。" +msgstr "" +"**Error between the asymptotic expression of the Bessel function and the " +"true value:** Dividing the integral into two parts can significantly " +"reduce this error." + +#: ../../source/Advanced/filon/linear_filon.rst:56 +msgid "" +"**区间内核函数线性拟合与真实值的误差:** 该误差受人为设定的Filon积分间隔控制。当 **区间过大** " +"时,线性拟合效果很差,计算结果偏差较大。" +msgstr "" +"**Error between the linear fitting of the kernel function within the " +"interval and the true value:** This error is controlled by the manually " +"set Filon's integration interval. When the **interval is too large**, the" +" linear fitting effect is poor, and the calculation result deviates " +"significantly." + +#: ../../source/Advanced/filon/linear_filon.rst:59 +msgid "通过以下可选参数,可使用Filon积分。" +msgstr "Filon's integration can be used through the following optional parameters." + +#: ../../source/Advanced/filon/linear_filon.rst:63 +msgid "C" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:65 +msgid "" +":command:`grt` 和 :command:`stgrt` 程序支持以下可选参数来使用Filon积分,具体说明详见 " +":command:`grt -h` 或 :command:`stgrt -h`。" +msgstr "" +"The :command:`grt` and :command:`stgrt` programs support the following " +"optional parameters to use Filon's integration. For detailed " +"explanations, see :command:`grt -h` or :command:`stgrt -h`." + +#: ../../source/Advanced/filon/linear_filon.rst:67 +msgid "``-L[//]``" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:69 +msgid "```` 定义离散波数积分的积分间隔 (见 :ref:`k_integ_rst` 部分)" +msgstr "" +"```` defines the integration interval for discrete wavenumber " +"integration (see :ref:`k_integ_rst` section)." + +#: ../../source/Advanced/filon/linear_filon.rst:70 +msgid "```` 定义Filon积分间隔,公式和离散波数积分使用的一致。" +msgstr "" +"```` defines the Filon's integration interval, consistent with " +"the formula used for discrete wavenumber integration." + +#: ../../source/Advanced/filon/linear_filon.rst:71 +msgid "```` 定义了两个积分的分割点, :math:`k^*=` ```` :math:`/r_{\\text{max}}`" +msgstr "" +"```` defines the division point of the two integrals, :math:`k^*=` " +"```` :math:`/r_{\\text{max}}`." + +#: ../../source/Advanced/filon/linear_filon.rst:73 +msgid "Python" +msgstr "" + +#: ../../source/Advanced/filon/linear_filon.rst:75 +msgid "" +":func:`compute_grn() ` 函数和 " +":func:`compute_static_grn() ` " +"函数支持以下可选参数来使用Filon积分,具体说明详见API。" +msgstr "" +"The :func:`compute_grn() ` function " +"and :func:`compute_static_grn() " +"` function support the " +"following optional parameters to use Filon's integration. For detailed " +"explanations, see the API." + +#: ../../source/Advanced/filon/linear_filon.rst:77 +msgid "``filonLength:float`` 对应C选项卡中的 ```` 参数" +msgstr "" +"``filonLength:List`` corresponding to the ```` in the C tab." + +#: ../../source/Advanced/filon/linear_filon.rst:78 +msgid "``filonCut:float`` 对应C选项卡中的 ```` 参数" +msgstr "" +"``filonCut:float`` corresponding to the ```` in the C tab." + diff --git a/docs/locales/en/LC_MESSAGES/Advanced/filon/self_adaptive_filon.po b/docs/locales/en/LC_MESSAGES/Advanced/filon/self_adaptive_filon.po new file mode 100644 index 00000000..a9415cad --- /dev/null +++ b/docs/locales/en/LC_MESSAGES/Advanced/filon/self_adaptive_filon.po @@ -0,0 +1,146 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2025, Zhu Dengda +# This file is distributed under the same license as the PyGRT package. +# FIRST AUTHOR , 2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PyGRT 0.7.1.dev29+g6f42373.d20250505\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-05 22:22+0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:5 +msgid "自适应Filon积分法" +msgstr "Self-Adaptive Filon's Integration Method" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst +msgid "Author" +msgstr "" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:7 +msgid "Zhu Dengda" +msgstr "" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst +msgid "Email" +msgstr "" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:8 +msgid "zhudengda@mail.iggcas.ac.cn" +msgstr "" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:12 +msgid "" +"在 :ref:`linear_filon` 部分简单介绍了Filon积分的过程与核心原理,即 **分段计算积分的解析解**,而以下介绍的 " +"**自适应Filon积分法(SAFIM)** ,便是 **动态分段**,在核函数变化剧烈的部分多采样,在核函数变化平缓的部分少采样。具体原理详见 " +":ref:`(Chen and Zhang, 2001) ` :ref:`(张海明, 2021) " +"` 。" +msgstr "" +"In the :ref:`linear_filon` section, the process and core principles of Filon's integration are briefly introduced, namely **piecewise analytical solutions of the integral**. The following introduces the **Self-Adaptive Filon's Integration Method (SAFIM)**, which is **dynamic segmentation**, sampling more in regions where the kernel function changes drastically and less in regions where it changes smoothly. For detailed principles, see :ref:`(Chen and Zhang, 2001) ` :ref:`(Zhang Haiming, 2021) `." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:16 +msgid "参数介绍" +msgstr "Arguments" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:18 +msgid "通过以下可选参数,可使用自适应Filon积分。" +msgstr "SAFIM can be used through the following optional parameters." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:22 +#: ../../source/Advanced/filon/self_adaptive_filon.rst:45 +msgid "C" +msgstr "" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:24 +msgid "" +":command:`grt` 和 :command:`stgrt` 程序支持以下可选参数来使用自适应Filon积分,具体说明详见 " +":command:`grt -h` 或 :command:`stgrt -h`。" +msgstr "" +"The :command:`grt` and :command:`stgrt` programs support the following " +"optional parameters to use SAFIM. For detailed " +"explanations, see :command:`grt -h` or :command:`stgrt -h`." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:26 +msgid "``-La[//]``" +msgstr "" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:28 +msgid "" +"```` 定义离散波数积分的积分间隔 (见 :ref:`k_integ_rst` 部分, :ref:`linear_filon`" +" 部分)" +msgstr "" +"```` defines the integration interval for discrete wavenumber " +"integration (see :ref:`k_integ_rst` section, :ref:`linear_filon` section)." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:29 +msgid "" +"```` 定义自适应采样精度,见 :ref:`(Chen and Zhang, 2001) ` " +":ref:`(张海明, 2021) `,通常1e-2即可。" +msgstr "" +"```` defines the precision of self-adaptive sampling, see :ref:`(Chen and Zhang, 2001) ` :ref:`(张海明, 2021) `. In general set 1e-2." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:30 +msgid "" +"```` 定义了两个积分的分割点, :math:`k^*=` ```` :math:`/r_{\\text{max}}` " +"(见 :ref:`linear_filon` 部分)" +msgstr "" +"```` defines the division point of the two integrals, :math:`k^*=` " +"```` :math:`/r_{\\text{max}}`." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:32 +#: ../../source/Advanced/filon/self_adaptive_filon.rst:52 +msgid "Python" +msgstr "" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:34 +msgid "" +":func:`compute_grn() ` 函数和 " +":func:`compute_static_grn() ` " +"函数支持以下可选参数来使用自适应Filon积分,具体说明详见API。" +msgstr "" +"The :func:`compute_grn() ` function " +"and :func:`compute_static_grn() " +"` function support the " +"following optional parameters to use SAFIM. For detailed " +"explanations, see the API." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:36 +msgid "``safilonTol:float`` 对应C选项卡中的 ```` 参数" +msgstr "" +"``safilonTol:List`` corresponding to the ```` in the C tab." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:37 +msgid "``filonCut:float`` 对应C选项卡中的 ```` 参数" +msgstr "" +"``filonCut:float`` corresponding to the ```` in the C tab." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:41 +msgid "示例程序" +msgstr "Simple run" + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:47 +msgid "使用 ``-S`` 导出核函数文件," +msgstr "use ``-S`` to export kernel function files." + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:58 +msgid "使用以下Python脚本绘制核函数采样点," +msgstr "" +"Use the following Python script to plot the kernel sample points," + +#: ../../source/Advanced/filon/self_adaptive_filon.rst:68 +msgid "" +"从对比图可以清晰地看出,自适应采样用更少的点数勾勒核函数的主要特征,这显著提高了计算效率。尽管自适应过程增加了额外的计算量,在小震中距范围内计算优势不明显," +" **但随着震中距的增加,自适应Filon积分的优势将愈发显著。**" +msgstr "" +"From the comparison chart, it is clear that SAFIM outlines the main features of the kernel function with fewer points, significantly improving computational efficiency. Although the SAFIM adds extra computational overhead, its computational advantage is not obvious in the small epicentral distance range, **but as the epicentral distance increases, the advantage of SAFIM becomes increasingly significant.**" + diff --git a/docs/locales/en/LC_MESSAGES/Advanced/filon_linear.po b/docs/locales/en/LC_MESSAGES/Advanced/filon_linear.po deleted file mode 100644 index 4ef0845f..00000000 --- a/docs/locales/en/LC_MESSAGES/Advanced/filon_linear.po +++ /dev/null @@ -1,187 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2025, Zhu Dengda -# This file is distributed under the same license as the PyGRT package. -# FIRST AUTHOR , 2025. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PyGRT 0.6.1.dev17+g4521452.d20250424\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-24 18:17+0800\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language: en\n" -"Language-Team: en \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.16.0\n" - -#: ../../source/Advanced/filon_linear.rst:2 -msgid "Filon积分法" -msgstr "Filon's Integration Method" - -#: ../../source/Advanced/filon_linear.rst -msgid "Author" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:4 -msgid "Zhu Dengda" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst -msgid "Email" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:5 -msgid "zhudengda@mail.iggcas.ac.cn" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:11 -msgid "" -"谨慎使用固定间隔的Filon积分法,除非你很清楚原理以及误差来源。后期会考虑加入 **自适应Filon积分法** :ref:`(张海明, 2021) " -"` 以减少固定积分间隔的影响。" -msgstr "" -"Use the fixed-interval Filon integration method with caution unless you fully understand its principles and sources of error. " -"In the future, **Self-Adaptive Filon's Integration Method** :ref:`(Zhang Haiming, 2021) ` " -"may be considered to mitigate the impact of fixed integration intervals." - -#: ../../source/Advanced/filon_linear.rst:14 -msgid "" -"以下介绍程序中使用的 **基于两点线性插值的Filon积分** :ref:`(纪晨, 姚振兴, 1995) ` " -":ref:`(初稿) ` ,主要介绍思路,具体公式推导详见对应论文。" -msgstr "" -"The following introduces the **Filon's Integration based on two-point linear interpolation** " -":ref:`(Ji Chen, Yao Zhenxing, 1995) ` :ref:`(初稿) ` " -"used in the program, mainly explaining the idea. For detailed formula derivations, refer to the corresponding paper." - -#: ../../source/Advanced/filon_linear.rst:16 -msgid "对于以下积分," -msgstr "For the following integral," - -#: ../../source/Advanced/filon_linear.rst:18 -msgid "P_m(\\omega,r) = \\int_0^{k_{\\text{max}}} F_m(k, \\omega)J_m(kr)kdk" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:22 -msgid "分成两个部分," -msgstr "It is divided into two parts," - -#: ../../source/Advanced/filon_linear.rst:24 -msgid "" -"P_m(\\omega,r) = \\int_0^{k^*} F_m(k, \\omega)J_m(kr)kdk + " -"\\int_{k^*}^{k_{\\text{max}}} F_m(k, \\omega)J_m(kr)kdk" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:28 -msgid "" -"其中积分第一部分仍然使用离散波数积分求解 (见 :ref:`k_integ_rst` " -"部分),积分第二部分将Bessel函数取渐近表达式,可将其转为以下形式" -msgstr "" -"The first part of the integral still uses discrete wavenumber integration to solve (see :ref:`k_integ_rst` section), " -"and the second part of the integral takes the asymptotic expression of the Bessel function, which can be transformed into the following form." - -#: ../../source/Advanced/filon_linear.rst:30 -msgid "" -"\\begin{align}\n" -"P_m(\\omega,r) &= \\sqrt{\\dfrac{2}{\\pi r}}\n" -"\\bbox[yellow] {\\int_{k^*}^{k_{\\text{max}}} \\bar{F}_m(k, \\omega) " -"\\text{cos} \\left( kr - (2m+1)\\pi/4 \\right) dk } \\\\\n" -"\\bar{F}_m(k, \\omega) &= \\sqrt{k} F_m(k, \\omega)\n" -"\\end{align}" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:38 -msgid "" -"其中高亮部分的积分是Filon积分的关键。在每一个区间 :math:`[k_i, k_{i+1}], k_i=(i-1) \\Delta k` " -"内,使用两点线性插值公式,:math:`\\bar{F}` 可表示为" -msgstr "" -"The highlighted part of the integral is the key to Filon's integration. In each interval :math:`[k_i, k_{i+1}], k_i=(i-1) \\Delta k`, " -"using the two-point linear interpolation formula, :math:`\\bar{F}` can be expressed as" - -#: ../../source/Advanced/filon_linear.rst:40 -msgid "" -"\\bar{F} = \\bar{F}_i + \\dfrac{\\bar{F}_{i+1} - \\bar{F}_i}{\\Delta k} " -"(k - k_i)" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:44 -msgid "" -"将此式代回积分公式中,可得到 " -"**该区间内的积分解析解**,而最终的解即为多个区间内解析解的和。可进一步推导,将相邻区间的解析解中的部分式子两两相消,得到更简化的整个区间的解析解。由于相比于Bessel函数," -" :math:`\\bar{F}` 往往变化比较缓慢,故Filon积分可使用相对较大的步长 :math:`\\Delta k` " -"也可以有很好的精度。" -msgstr "" -"Substituting this formula back into the integral formula yields " -"**the analytical solution of the integral within the interval**, and the final solution is the sum of the analytical solutions within multiple intervals. " -"Further derivation can simplify the analytical solution for the entire interval by canceling out parts of the formulas in adjacent intervals. " -"Since :math:`\\bar{F}` often changes more slowly compared to the Bessel function, Filon's integration can achieve good accuracy even with relatively large step sizes :math:`\\Delta k`." - -#: ../../source/Advanced/filon_linear.rst:50 -msgid "从以上推导可看出,该方法的精度取决于以下两个方面:" -msgstr "From the above derivation, it can be seen that the accuracy of this method depends on the following two aspects:" - -#: ../../source/Advanced/filon_linear.rst:52 -msgid "**Bessel函数渐近表达式与真实值的误差:** 通过将积分分为两个部分计算,可大幅减少该误差。" -msgstr "**Error between the asymptotic expression of the Bessel function and the true value:** Dividing the integral into two parts can significantly reduce this error." - -#: ../../source/Advanced/filon_linear.rst:54 -msgid "" -"**区间内核函数线性拟合与真实值的误差:** 该误差受人为设定的Filon积分间隔控制。当 **区间过大** " -"时,线性拟合效果很差,计算结果偏差较大。" -msgstr "" -"**Error between the linear fitting of the kernel function within the interval and the true value:** This error is controlled by the manually set Filon's integration interval. " -"When the **interval is too large**, the linear fitting effect is poor, and the calculation result deviates significantly." - -#: ../../source/Advanced/filon_linear.rst:57 -msgid "通过以下可选参数,可使用Filon积分。" -msgstr "Filon's integration can be used through the following optional parameters." - -#: ../../source/Advanced/filon_linear.rst:61 -msgid "C" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:63 -msgid "" -":command:`grt` 和 :command:`stgrt` 程序支持以下可选参数来使用Filon积分,具体说明详见 " -":command:`grt -h` 或 :command:`stgrt -h`。" -msgstr "" -"The :command:`grt` and :command:`stgrt` programs support the following optional parameters to use Filon's integration. " -"For detailed explanations, see :command:`grt -h` or :command:`stgrt -h`." - -#: ../../source/Advanced/filon_linear.rst:65 -msgid "``-L[//]``" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:67 -msgid "```` 定义离散波数积分的积分间隔 (见 :ref:`k_integ_rst` 部分)" -msgstr "```` defines the integration interval for discrete wavenumber integration (see :ref:`k_integ_rst` section)." - -#: ../../source/Advanced/filon_linear.rst:68 -msgid "```` 定义Filon积分间隔,公式和离散波数积分使用的一致。" -msgstr "```` defines the Filon's integration interval, consistent with the formula used for discrete wavenumber integration." - -#: ../../source/Advanced/filon_linear.rst:69 -msgid "```` 定义了两个积分的分割点, :math:`k^*=` ```` :math:`/r_{\\text{max}}`" -msgstr "```` defines the division point of the two integrals, :math:`k^*=` ```` :math:`/r_{\\text{max}}`." - -#: ../../source/Advanced/filon_linear.rst:71 -msgid "Python" -msgstr "" - -#: ../../source/Advanced/filon_linear.rst:73 -msgid "" -":func:`compute_grn() ` 函数和 " -":func:`compute_static_grn() ` " -"函数支持以下可选参数来使用Filon积分,具体说明详见API。" -msgstr "" -"The :func:`compute_grn() ` function and " -":func:`compute_static_grn() ` function " -"support the following optional parameters to use Filon's integration. For detailed explanations, see the API." - -#: ../../source/Advanced/filon_linear.rst:75 -msgid "``filonLC:List[float]`` 需给定两个量,分别对应C选项卡中的 ```` 参数和 ```` 参数。" -msgstr "``filonLC:List[float]`` requires two values, corresponding to the ```` and ```` parameters in the C tab." - diff --git a/docs/locales/en/LC_MESSAGES/index.po b/docs/locales/en/LC_MESSAGES/index.po index d1ba6e5e..8fcc7c6d 100644 --- a/docs/locales/en/LC_MESSAGES/index.po +++ b/docs/locales/en/LC_MESSAGES/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PyGRT 0.6.1.dev1+g4641a40.d20250422\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-22 17:22+0800\n" +"POT-Creation-Date: 2025-05-05 22:46+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -27,27 +27,27 @@ msgstr "Document Homepage" msgid "目录" msgstr "Table of Contents" -#: ../../source/index.rst:2 +#: ../../source/index.rst:2 msgid "**PyGRT** 文档" msgstr "**PyGRT** Document" -#: ../../source/index.rst +#: ../../source/index.rst msgid "Author" msgstr "" -#: ../../source/index.rst:4 +#: ../../source/index.rst:4 msgid "Zhu Dengda" msgstr "" -#: ../../source/index.rst +#: ../../source/index.rst msgid "Email" msgstr "" -#: ../../source/index.rst:5 +#: ../../source/index.rst:5 msgid "zhudengda@mail.iggcas.ac.cn" msgstr "" -#: ../../source/index.rst:20 +#: ../../source/index.rst:20 msgid "" "**PyGRT** : 一个用于计算在半无限水平分层均匀介质模型中的理论地震图的 " "**Python**\\程序包,使用广义反射透射系数矩阵法(**G**\\eneralized " @@ -58,36 +58,36 @@ msgstr "" "**G**\\eneralized **R**\\eflection-**T**\\ransmission coefficient matrix " "and Discrete Wavenumber Method. " -#: ../../source/index.rst:23 +#: ../../source/index.rst:23 msgid "**PyGRT** 能计算什么?" msgstr "What can **PyGRT** calculate?" -#: ../../source/index.rst:24 +#: ../../source/index.rst:24 msgid "目前,**PyGRT** 可计算区域尺度内半无限水平分层均匀介质中的 **动态与静态的位移,以及应力、应变、旋转张量。**" msgstr "" "At present, **PyGRT** can calculate **the dynamic and static " "displacements, as well as stress, strain and rotational tensors in semi-" "infinite horizontally layered media within the regional scale.**" -#: ../../source/index.rst:28 +#: ../../source/index.rst:28 msgid "运行平台" msgstr "Operation Platform" -#: ../../source/index.rst:29 +#: ../../source/index.rst:29 msgid "**Windows, Linux, MacOS**" msgstr "" -#: ../../source/index.rst:33 +#: ../../source/index.rst:33 msgid "程序特点" msgstr "Features" -#: ../../source/index.rst:35 +#: ../../source/index.rst:35 msgid "" "**格林函数频谱由C程序并行计算**。由于不同频率间的计算相互独立,在计算过程中基于 `OpenMP " "`_ 进行了 **并行优化**,极大提升了计算效率;" msgstr "" -"**The spectra of the Green's functions are calculated in parallel by the C" -" program.** Since the calculations among different frequencies are " +"**The spectra of the Green's functions are calculated in parallel by the " +"C program.** Since the calculations among different frequencies are " "independent of each other, the **parallel optimization** is based on " "`OpenMP `_ , which greatly improved the " "computational efficiency;" @@ -98,7 +98,7 @@ msgstr "" msgid "\\" msgstr "" -#: ../../source/index.rst:38 +#: ../../source/index.rst:38 msgid "" "**将Python语言的便携、可扩展性与C语言的计算高效特点结合**。C代码被编译链接成动态库 ``libgrt.so`` , **PyGRT**" " 再基于Python的 `ctypes `_ " @@ -119,41 +119,41 @@ msgstr "" "mature third-party libraries, it can flexibly realize various subsequent " "data processing." -#: ../../source/index.rst:41 +#: ../../source/index.rst:41 msgid "" "**明确的中文注释**。我在代码中对计算过程给出了明确的中文注释以及相关的公式索引, **所有公式索引(除非特别指明)均来自** " ":ref:`该初稿 " "`,在代码中基本按照公式推导的计算逻辑,在不过多损失计算效率的前提下进行适当优化,保证了代码的可读性,希望能给学习过程中的你提供一些参考,解答一些疑惑。仅是我浅薄的理解,仅作参考,欢迎指正。" msgstr "Rich comments in the code." -#: ../../source/index.rst:44 +#: ../../source/index.rst:44 msgid "**特殊情况下的计算优化**。目前包括两个部分:" msgstr "" "**Computational Optimization under Special Circumstances.** At present, " "it includes two parts:" -#: ../../source/index.rst:47 +#: ../../source/index.rst:47 msgid "" "**当震中距** :math:`r` **很大时**。由于结果中Bessel函数的形式为 " ":math:`J_m(kr)`,当震中距变大时,积分要求波数 :math:`k` 的积分间隔就越小,导致计算变慢。目前 **PyGRT** 实现了" -" **基于线性插值的Filon积分** 以缓解此问题 :ref:`(纪晨, 姚振兴, 1995) ` " -":ref:`(初稿) ` " -",将每个积分小区间内的Bessel函数取渐近公式,使每个区间内的积分近似值可获得解析解,这样可加大波数 :math:`k` " -"的积分间隔,提高计算速度。" +" **基于线性插值的Filon积分** :ref:`(纪晨, 姚振兴, 1995) ` :ref:`(初稿) " +"` 和 **自适应Filon积分** :ref:`(Chen and Zhang, 2001) " +"` :ref:`(张海明, 2021) ` 以缓解此问题,可显著提高计算速度。" msgstr "" "**When epicentral distance** :math:`r` **is large.** Since the Bessel " "function :math:`J_m(kr)` in the integrand, when the epicentral distance " "increases, integrand oscillates more rapidly, requiring smaller " "integration steps , which significantly reduces computational efficiency." " At present, **PyGRT** implements **Filon's Integration based on linear " -"interpolation** to alleviate this problem :ref:`(纪晨, 姚振兴, 1995) " -"` :ref:`(初稿) ` . The Bessel function " +"interpolation** :ref:`(纪晨, 姚振兴, 1995) ` :ref:`(初稿) ` " +"and **Self-Adaptive Filon's Integration** :ref:`(Chen and Zhang, 2001) " +"` :ref:`(张海明, 2021) ` to alleviate this problem . The Bessel function " "in each integral cell is asymptotical formula, so that the analytical " "solution can be obtained by the approximation of the integral in each " "interval, which can increase the integration interval of the wavenumber " "and improve the calculation speed." -#: ../../source/index.rst:50 +#: ../../source/index.rst:50 msgid "" "**当震源深度和台站深度很接近时(如第一类Lamb问题,台站和震源均位于地表)**。此时核函数随着波数 :math:`k` " "的增加收敛非常慢,会在收敛值上下波动,导致很难到达到指定的收敛条件,需要耗费更多时间以达到更高的积分上限。目前 **PyGRT** 实现了 " @@ -174,20 +174,20 @@ msgstr "" "the reduced sequence :math:`M_i \\leftarrow 0.5\\times(M_i + M_{i+1})` is" " recursively taken to obtain the convergence value." -#: ../../source/index.rst:53 +#: ../../source/index.rst:53 msgid "" "**积分过程可输出记录文件**。通过函数参数设置,在计算格林函数频谱时可输出不同频率的积分过程文件,记录了核函数随波数 :math:`k` " "的变化,且 **PyGRT** 包含了读取该文件的Python函数,可以简易地观察到相关量的变化,方便各种测试以及学习过程中的理解。" msgstr "" "**The integration process can output states files.** By setting the " "parameters, the integration process files of different frequencies can be" -" output when calculating the spectra of Green's function, and the " -"changes of the kernel function with the wavenumber are recorded. " -"**PyGRT** includes Python functions to read the file, so that the changes" -" of relevant quantities can be easily observed, which is convenient for " +" output when calculating the spectra of Green's function, and the changes" +" of the kernel function with the wavenumber are recorded. **PyGRT** " +"includes Python functions to read the file, so that the changes of " +"relevant quantities can be easily observed, which is convenient for " "various tests and understanding in the learning process." -#: ../../source/index.rst:59 +#: ../../source/index.rst:59 msgid "" "以下包括 **Python** 和 **C** 两部分的API介绍。如果只关心程序的使用,可以只查看 **Python** " "部分;若对具体实现过程感兴趣,尤其是在学习 **广义反射透射系数矩阵、离散波数法、线性Filon积分法、峰谷平均法** " @@ -195,7 +195,7 @@ msgid "" ",希望能帮助你在学习相关内容时解答一些疑惑。" msgstr "\\" -#: ../../source/index.rst:61 +#: ../../source/index.rst:61 msgid "" "本文档页面源码位于 Github主页的 `docs/ " "`_,可查看示例代码和画图脚本。" @@ -204,11 +204,11 @@ msgstr "" "`docs/ `_, where" " you can view the example code and drawing scripts." -#: ../../source/index.rst:81 +#: ../../source/index.rst:82 msgid "主要参考" msgstr "Main References" -#: ../../source/index.rst:85 +#: ../../source/index.rst:86 msgid "" "Michel Bouchon. 1981. A simple method to calculate Green's functions for " "elastic layered media. Bulletin of the Seismological Society of America. " @@ -216,13 +216,13 @@ msgid "" "`_" msgstr "" -#: ../../source/index.rst:89 +#: ../../source/index.rst:90 msgid "纪晨, 姚振兴, 1995. 区域地震范围的宽频带理论地震图算法研究[J]. 地球物理学报, 38(4): 460-468." msgstr "" "Ji C, Yao Z, 1995. THE STUDY OF THE METHOD FOR BROADBAND REGIONAL " "SYNTHETIC SEISMOGRAM[J]. Chinese Journal of Geophysics. 38(4): 460-468." -#: ../../source/index.rst:93 +#: ../../source/index.rst:94 msgid "" "谢小碧, 姚振兴, 1989. 计算分层介质中位错点源静态位移场的广义反射、透射系数矩阵和离散波数方法[J]. 地球物理学报, 32(3): " "270-280." @@ -232,11 +232,11 @@ msgstr "" "Half-Space by DisLocation Source[J]. Acta Geophysics Sinica, 32(3): " "270-280." -#: ../../source/index.rst:97 +#: ../../source/index.rst:98 msgid "姚振兴, 谢小碧. 2022/03. 理论地震图及其应用(初稿)." msgstr "" -#: ../../source/index.rst:101 +#: ../../source/index.rst:102 msgid "" "Yao Z. X. and D. G. Harkrider. 1983. A generalized refelection-" "transmission coefficient matrix and discrete wavenumber method for " @@ -244,11 +244,11 @@ msgid "" "`10.1785/BSSA07306A1685 `_" msgstr "" -#: ../../source/index.rst:105 +#: ../../source/index.rst:106 msgid "张海明. 2021. 地震学中的Lamb问题(上). 科学出版社." msgstr "" -#: ../../source/index.rst:109 +#: ../../source/index.rst:110 msgid "" "Zhang, H. M., Chen, X. F., and Chang, S. 2003. An efficient numerical " "method for computing synthetic seismograms for a layered half-space with " @@ -258,3 +258,11 @@ msgid "" "`_" msgstr "" +#: ../../source/index.rst:114 +msgid "" +"Chen, X., Zhang, H., 2001. An Efficient Method for Computing Green’s " +"Functions for a Layered Half-Space at Large Epicentral Distances. " +"Bulletin of the Seismological Society of America 91, 858–869. doi: " +"`10.1785/0120000113 `_" +msgstr "" + diff --git a/docs/source/Advanced/filon_linear.rst b/docs/source/Advanced/filon/linear_filon.rst similarity index 90% rename from docs/source/Advanced/filon_linear.rst rename to docs/source/Advanced/filon/linear_filon.rst index afec422c..a03a9efb 100644 --- a/docs/source/Advanced/filon_linear.rst +++ b/docs/source/Advanced/filon/linear_filon.rst @@ -1,5 +1,7 @@ -Filon积分法 -=================== +.. _linear_filon: + +固定间隔的Filon积分法 +========================= :Author: Zhu Dengda :Email: zhudengda@mail.iggcas.ac.cn @@ -8,7 +10,7 @@ Filon积分法 .. warning:: - 谨慎使用固定间隔的Filon积分法,除非你很清楚原理以及误差来源。后期会考虑加入 **自适应Filon积分法** :ref:`(张海明, 2021) ` 以减少固定积分间隔的影响。 + 谨慎使用固定间隔的Filon积分法,除非你很清楚原理以及误差来源。推荐使用 :ref:`self_adaptive_filon` 以减少固定积分间隔的影响。 以下介绍程序中使用的 **基于两点线性插值的Filon积分** :ref:`(纪晨, 姚振兴, 1995) ` :ref:`(初稿) ` ,主要介绍思路,具体公式推导详见对应论文。 @@ -72,4 +74,5 @@ Filon积分法 :func:`compute_grn() ` 函数和 :func:`compute_static_grn() ` 函数支持以下可选参数来使用Filon积分,具体说明详见API。 - + ``filonLC:List[float]`` 需给定两个量,分别对应C选项卡中的 ```` 参数和 ```` 参数。 + + ``filonLength:float`` 对应C选项卡中的 ```` 参数 + + ``filonCut:float`` 对应C选项卡中的 ```` 参数 diff --git a/docs/source/Advanced/filon/run/milrow b/docs/source/Advanced/filon/run/milrow new file mode 100644 index 00000000..a99f4912 --- /dev/null +++ b/docs/source/Advanced/filon/run/milrow @@ -0,0 +1,9 @@ +0.2 3.4 1.7 2.3 9e10 9e10 +0.6 3.7 1.9 2.4 9e10 9e10 +0.5 4.2 2.1 2.4 9e10 9e10 +0.5 4.6 2.3 2.5 9e10 9e10 +0.7 4.9 2.8 2.6 9e10 9e10 +0.5 5.1 2.9 2.7 9e10 9e10 +6.0 5.9 3.3 2.7 9e10 9e10 +1. 6.9 4.0 2.8 9e10 9e10 +0.0 8.2 4.7 3.2 9e10 9e10 \ No newline at end of file diff --git a/docs/source/Advanced/filon/run/plot.py b/docs/source/Advanced/filon/run/plot.py new file mode 100644 index 00000000..e252cdb8 --- /dev/null +++ b/docs/source/Advanced/filon/run/plot.py @@ -0,0 +1,33 @@ +import numpy as np +import matplotlib.pyplot as plt +import pygrt + +statsdata1 = pygrt.utils.read_statsfile("GRN1_grtstats/milrow_5_0/K_0500_2.50000e-01") +statsdata2 = pygrt.utils.read_statsfile("GRN2_grtstats/milrow_5_0/K_0500_2.50000e-01") +srctype = 'DD_q' + +fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(10, 6), sharex=True) +xlim = [0, 0.65] + +karr = statsdata1['k'] +_filt = np.logical_and(karr <= xlim[1], karr >= xlim[0]) +karr = karr[_filt] +Farr = statsdata1[srctype][_filt] +ax1.vlines(karr, -1, 1, lw=0.1) +ax1.plot(karr, np.real(Farr)/np.max(np.real(Farr)), 'o-', ms=0.5, mec='r', mfc='r', c='k', lw=0.5) +ax1.grid() +ax1.set_xlim(xlim) +ax1.set_title(f"Fixed Interval (npts={len(karr)})") + +karr = statsdata2['k'] +_filt = np.logical_and(karr <= xlim[1], karr >= xlim[0]) +karr = karr[_filt] +Farr = statsdata2[srctype][_filt] +ax2.vlines(karr, -1, 1, lw=0.1) +ax2.plot(karr, np.real(Farr)/np.max(np.real(Farr)), 'o-', ms=0.5, mec='r', mfc='r', c='k', lw=0.5) +ax2.grid() +ax2.set_xlim(xlim) +ax2.set_title(f"Self-Adaptive Interval (npts={len(karr)})") + +fig.tight_layout() +fig.savefig("safim.png", dpi=300, bbox_inches='tight') \ No newline at end of file diff --git a/docs/source/Advanced/filon/run/run.py b/docs/source/Advanced/filon/run/run.py new file mode 100644 index 00000000..d462c3db --- /dev/null +++ b/docs/source/Advanced/filon/run/run.py @@ -0,0 +1,16 @@ +import numpy as np +import pygrt + +modarr = np.loadtxt("milrow") + +pymod = pygrt.PyModel1D(modarr, 5, 0) + +st_grn = pymod.compute_grn( + distarr=[2500], + nt=2000, + dt=1, + Length=20, + safilonTol=1e-2, # 自适应采样精度 + filonCut=10, + delayT0=100, +)[0] diff --git a/docs/source/Advanced/filon/run/run.sh b/docs/source/Advanced/filon/run/run.sh new file mode 100755 index 00000000..bc63a956 --- /dev/null +++ b/docs/source/Advanced/filon/run/run.sh @@ -0,0 +1,10 @@ +#!/bin/bash +rm -rf GRN* + +# method 1: DWM +# 使用-H来节省一些时间,只输出单个频率以作示例 +grt -Mmilrow -OGRN1 -N2000/1 -D5/0 -R2500 -L20 -H0.25/0.25 -S-1 + +# method 2: SAFIM +# 使用-La指定相关参数 +grt -Mmilrow -OGRN2 -N2000/1 -D5/0 -R2500 -La20/1e-2/10 -S500 \ No newline at end of file diff --git a/docs/source/Advanced/filon/self_adaptive_filon.rst b/docs/source/Advanced/filon/self_adaptive_filon.rst new file mode 100644 index 00000000..19bc9492 --- /dev/null +++ b/docs/source/Advanced/filon/self_adaptive_filon.rst @@ -0,0 +1,68 @@ + +.. _self_adaptive_filon: + +自适应Filon积分法 +=================== + +:Author: Zhu Dengda +:Email: zhudengda@mail.iggcas.ac.cn + +----------------------------------------------------------- + +在 :ref:`linear_filon` 部分简单介绍了Filon积分的过程与核心原理,即 **分段计算积分的解析解**,而以下介绍的 **自适应Filon积分法(SAFIM)** ,便是 **动态分段**,在核函数变化剧烈的部分多采样,在核函数变化平缓的部分少采样。具体原理详见 :ref:`(Chen and Zhang, 2001) ` :ref:`(张海明, 2021) ` 。 + + +参数介绍 +------------------ + +通过以下可选参数,可使用自适应Filon积分。 + +.. tabs:: + + .. group-tab:: C + + :command:`grt` 和 :command:`stgrt` 程序支持以下可选参数来使用自适应Filon积分,具体说明详见 :command:`grt -h` 或 :command:`stgrt -h`。 + + + ``-La[//]`` + + + ```` 定义离散波数积分的积分间隔 (见 :ref:`k_integ_rst` 部分, :ref:`linear_filon` 部分) + + ```` 定义自适应采样精度,见 :ref:`(Chen and Zhang, 2001) ` :ref:`(张海明, 2021) `,通常1e-2即可。 + + ```` 定义了两个积分的分割点, :math:`k^*=` ```` :math:`/r_{\text{max}}` (见 :ref:`linear_filon` 部分) + + .. group-tab:: Python + + :func:`compute_grn() ` 函数和 :func:`compute_static_grn() ` 函数支持以下可选参数来使用自适应Filon积分,具体说明详见API。 + + + ``safilonTol:float`` 对应C选项卡中的 ```` 参数 + + ``filonCut:float`` 对应C选项卡中的 ```` 参数 + + +示例程序 +------------------ + +.. tabs:: + + .. group-tab:: C + + 使用 ``-S`` 导出核函数文件, + + .. literalinclude:: run/run.sh + :language: bash + + .. group-tab:: Python + + .. literalinclude:: run/run.py + :language: python + + +使用以下Python脚本绘制核函数采样点, + +.. literalinclude:: run/plot.py + :language: python + + +.. image:: run/safim.png + :align: center + + +从对比图可以清晰地看出,自适应采样用更少的点数勾勒核函数的主要特征,这显著提高了计算效率。尽管自适应过程增加了额外的计算量,在小震中距范围内计算优势不明显, **但随着震中距的增加,自适应Filon积分的优势将愈发显著。** \ No newline at end of file diff --git a/docs/source/Advanced/index.rst b/docs/source/Advanced/index.rst index f8b59a50..a4f40f6b 100644 --- a/docs/source/Advanced/index.rst +++ b/docs/source/Advanced/index.rst @@ -12,6 +12,7 @@ :maxdepth: 1 k_integ - filon_linear + filon/linear_filon + filon/self_adaptive_filon integ_converg/integ_converg kernel/kernel diff --git a/docs/source/index.rst b/docs/source/index.rst index f970097f..ec9bc40c 100755 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -44,7 +44,7 @@ + **特殊情况下的计算优化**。目前包括两个部分: \ - - **当震中距** :math:`r` **很大时**。由于结果中Bessel函数的形式为 :math:`J_m(kr)`,当震中距变大时,积分要求波数 :math:`k` 的积分间隔就越小,导致计算变慢。目前 **PyGRT** 实现了 **基于线性插值的Filon积分** 以缓解此问题 :ref:`(纪晨, 姚振兴, 1995) ` :ref:`(初稿) ` ,将每个积分小区间内的Bessel函数取渐近公式,使每个区间内的积分近似值可获得解析解,这样可加大波数 :math:`k` 的积分间隔,提高计算速度。 + - **当震中距** :math:`r` **很大时**。由于结果中Bessel函数的形式为 :math:`J_m(kr)`,当震中距变大时,积分要求波数 :math:`k` 的积分间隔就越小,导致计算变慢。目前 **PyGRT** 实现了 **基于线性插值的Filon积分** :ref:`(纪晨, 姚振兴, 1995) ` :ref:`(初稿) ` 和 **自适应Filon积分** :ref:`(Chen and Zhang, 2001) ` :ref:`(张海明, 2021) ` 以缓解此问题,可显著提高计算速度。 \ - **当震源深度和台站深度很接近时(如第一类Lamb问题,台站和震源均位于地表)**。此时核函数随着波数 :math:`k` 的增加收敛非常慢,会在收敛值上下波动,导致很难到达到指定的收敛条件,需要耗费更多时间以达到更高的积分上限。目前 **PyGRT** 实现了 **峰谷平均法** 以缓解此问题 :ref:`(Zhang et al., 2003) ` :ref:`(张海明, 2021) `,当波数 :math:`k` 达到一定上限时,可以统计波动的波峰波谷值,再递归取缩减序列 :math:`M_i \leftarrow 0.5\times(M_i + M_{i+1})` 得到收敛值。 @@ -109,3 +109,6 @@ .. [7] Zhang, H. M., Chen, X. F., and Chang, S. 2003. An efficient numerical method for computing synthetic seismograms for a layered half-space with sources and receivers at close or same depths. Seismic motion, lithospheric structures, earthquake and volcanic sources: The Keiiti Aki volume, 467-486. doi: `10.1007/978-3-0348-8010-7_3 `_ +.. _chen_2001: + +.. [8] Chen, X., Zhang, H., 2001. An Efficient Method for Computing Green’s Functions for a Layered Half-Space at Large Epicentral Distances. Bulletin of the Seismological Society of America 91, 858–869. doi: `10.1785/0120000113 `_ \ No newline at end of file diff --git a/docs/source/run_all.sh b/docs/source/run_all.sh index 14c40c5c..95090937 100755 --- a/docs/source/run_all.sh +++ b/docs/source/run_all.sh @@ -51,4 +51,12 @@ if [[ $1 == '6' || $1 == '' ]]; then ./run.sh python run.py cd - +fi + +if [[ $1 == '7' || $1 == '' ]]; then + cd Advanced/filon/run + chmod +x *.sh + ./run.sh + python run.py + cd - fi \ No newline at end of file