Skip to content

Commit

Permalink
add an extended version of iem. Still siplier than AIEM but better th…
Browse files Browse the repository at this point in the history
…an IEM Fung 92
  • Loading branch information
ghislainp committed Aug 27, 2020
1 parent b9784a9 commit c3a01a8
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
38 changes: 38 additions & 0 deletions smrt/interface/iem_fung92_brogioni10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@


"""
Implement the interface boundary condition under IEM formulation provided by Fung et al. 1992. in IEEE TGRS
with an extended domain of validity (for large roughness or correlation length) by switching the Fresnel
coefficients according to Briogoni et al. 2010, IJRS. A better but more complex approach is given by Wu et al. 2003 (to be implemented)
Use of this code requires special attention
"""

import numpy as np

from smrt.core.fresnel import fresnel_coefficients
from smrt.interface.iem_fung92 import IEM_Fung92
from smrt.core.error import SMRTError


class IEM_Fung92_Briogoni10(IEM_Fung92):
"""A moderate rough surface model with backscatter, specular reflection and transmission only. Use with care!
"""

def check_validity(self, ks, kl, eps_r):

# check validity
if ks > 3:
raise SMRTError("Warning, roughness_rms is too high for the given wavelength. Limit is ks < 3. Here ks=%g" % ks)

def fresnel_coefficients(self, eps_1, eps_2, mu_i, ks, kl):
"""calculate the fresnel coefficients at the angle mu_i or 0° depending on ks*kl. The transition is abrupt."""

if ks * kl > np.sqrt(eps_2 / eps_1):
Rv, Rh, _ = fresnel_coefficients(eps_1, eps_2, 1)
else:
Rv, Rh, _ = fresnel_coefficients(eps_1, eps_2, mu_i)
return Rv, Rh
51 changes: 51 additions & 0 deletions smrt/interface/test_iem_fung92_brogioni10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

import numpy as np
from smrt.interface.iem_fung92_brogioni10 import IEM_Fung92_Briogoni10
from smrt.interface.iem_fung92 import IEM_Fung92
from smrt.utils import dB

def test_iem_fung92_biogoni10_continuty():

eps_r = 3 + 0.1j

iem_fung = IEM_Fung92(roughness_rms=0.429e-2, corr_length=3e-2)
iem_fung_brogioni = IEM_Fung92_Briogoni10(roughness_rms=0.429e-2, corr_length=3e-2)

frequency = 2.2e9

mu = np.cos(np.deg2rad([30, 50, 60]))

R = iem_fung.diffuse_reflection_matrix(frequency, 1, eps_r, mu, mu, np.pi, 2, debug=True)

R2 = iem_fung_brogioni.diffuse_reflection_matrix(frequency, 1, eps_r, mu, mu, np.pi, 2, debug=True)

sigma_vv = dB(4*np.pi * mu * R[0])
sigma_hh = dB(4*np.pi * mu * R[1])

sigma_vv2 = dB(4*np.pi * mu * R2[0])
sigma_hh2 = dB(4*np.pi * mu * R2[1])

assert np.allclose(sigma_vv, sigma_vv2)
assert np.allclose(sigma_hh, sigma_hh2)



def test_iem_fung92_brogioni10():

eps_r = 3 + 0.1j

iem_fung = IEM_Fung92_Briogoni10(roughness_rms=0.429e-2, corr_length=30e-2)

frequency = 2.2e9

mu = np.cos(np.deg2rad([30, 50, 60]))

R = iem_fung.diffuse_reflection_matrix(frequency, 1, eps_r, mu, mu, np.pi, 2, debug=True)
sigma_vv = dB(4*np.pi * mu * R[0])
sigma_hh = dB(4*np.pi * mu * R[1])

print(sigma_vv)
print(sigma_hh)

assert np.all(np.abs(sigma_vv - [-25.8475821, -28.09794986, -27.1320767 ]) < 1e-2)
assert np.all(np.abs(sigma_hh - [-31.30415086, -40.67474292, -29.06341978]) < 1e-2)
17 changes: 17 additions & 0 deletions smrt/substrate/iem_fung92_brogioni10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# coding: utf-8


"""
Implement the flat interface boundary for the bottom layer (substrate). The reflection and transmission
are computed using the Fresnel coefficients. This model does not take any specific parameter.
"""

# local import
from smrt.interface.iem_fung92_brogioni10 import IEM_Fung92_Briogoni10 as iIEM_Fung92_Briogoni10
from smrt.core.interface import substrate_from_interface

# autogenerate from interface.Flat
@substrate_from_interface(iIEM_Fung92_Briogoni10)
class IEM_Fung92_Briogoni10:
pass

0 comments on commit c3a01a8

Please sign in to comment.