From a7e06e3e00173c7fb7d4985ee3aa4d865f3cf7c9 Mon Sep 17 00:00:00 2001 From: Dengda98 Date: Thu, 31 Jul 2025 21:57:06 +0800 Subject: [PATCH] FIX: allow zero Q^-1, and relevant attenuation scale equals 1.0 --- pygrt/C_extension/src/common/model.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygrt/C_extension/src/common/model.c b/pygrt/C_extension/src/common/model.c index 68f6833d..6fbefc6d 100755 --- a/pygrt/C_extension/src/common/model.c +++ b/pygrt/C_extension/src/common/model.c @@ -210,8 +210,8 @@ void update_mod1d_omega(MODEL1D *mod1d, MYCOMPLEX omega){ Va0 = lay->Va; Vb0 = lay->Vb; - atna = attenuation_law(lay->Qainv, omega); - atnb = attenuation_law(lay->Qbinv, omega); + atna = (lay->Qainv > 0.0)? attenuation_law(lay->Qainv, omega) : 1.0; + atnb = (lay->Qbinv > 0.0)? attenuation_law(lay->Qbinv, omega) : 1.0; ka0 = omega/(Va0*atna); kb0 = (Vb0>RZERO)? omega/(Vb0*atnb) : CZERO;