1010
1111def create_absorption_variables (kgrid : kWaveGrid , medium : kWaveMedium , equation_of_state ):
1212 # define the lossy derivative operators and proportionality coefficients
13+ """
14+ Selects and returns absorption and dispersion operators and coefficients for the given medium based on the equation of state.
15+
16+ Parameters:
17+ kgrid (kWaveGrid): Grid object providing wavenumber array via `kgrid.k`.
18+ medium (kWaveMedium): Medium properties used to compute absorption/dispersion coefficients.
19+ equation_of_state (str): One of `"absorbing"`, `"stokes"`, or `"lossless"` determining which variables to produce.
20+
21+ Returns:
22+ tuple: (nabla1, nabla2, tau, eta)
23+ - nabla1: First-order absorption operator or `None` when not applicable.
24+ - nabla2: Dispersion operator or `None` when not applicable.
25+ - tau: Absorbing coefficient or `None` when not applicable.
26+ - eta: Dispersive coefficient or `None` when not applicable.
27+
28+ Behavior:
29+ - "absorbing": returns (nabla1, nabla2, tau, eta) computed for an absorbing medium.
30+ - "stokes": returns (None, None, tau, None) where `tau` is the Stokes absorbing coefficient.
31+ - "lossless": returns (None, None, None, None).
32+ """
1333 if equation_of_state == "absorbing" :
1434 return create_absorbing_medium_variables (kgrid .k , medium )
1535 elif equation_of_state == "stokes" :
@@ -107,4 +127,4 @@ def apply_alpha_filter(medium, nabla1, nabla2):
107127 # shift the parameters back
108128 nabla1 = np .fft .ifftshift (nabla1 )
109129 nabla2 = np .fft .ifftshift (nabla2 )
110- return nabla1 , nabla2
130+ return nabla1 , nabla2
0 commit comments