Skip to content

Commit

Permalink
change default GmfModel incidence range to 16-66 ; exception for gmf_…
Browse files Browse the repository at this point in the history
…s1_v2 / gmf_rs2_v2
  • Loading branch information
vincelhx committed Sep 12, 2024
1 parent 5909bdb commit 4cb8e15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 40 deletions.
1 change: 1 addition & 0 deletions src/xsarsea/windspeed/gmfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def inner(func):
cls._name_prefix, gmf_name))

wspd_range = kwargs.pop('wspd_range', None)

if wspd_range is None:
if len(set(pol)) == 1:
# copol
Expand Down
40 changes: 2 additions & 38 deletions src/xsarsea/windspeed/gmfs_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def gmf_cmodifr2(inc_angle, wind_speed, wind_dir):
# return sig


@GmfModel.register(wspd_range=[3., 80.], pol='VH', units='linear', defer=True)
@GmfModel.register(wspd_range=[3., 80.], inc_range=[17., 50.], pol='VH', units='linear', defer=True)
def gmf_rs2_v2(incidence, speed, phi=None):
"""
Radarsat-2 VH GMF : relation between sigma0, incidence and windspeed.
Expand Down Expand Up @@ -249,7 +249,7 @@ def gmf_rs2_v2(incidence, speed, phi=None):
return sig_Final


@GmfModel.register(wspd_range=[3., 80.], pol='VH', units='linear', defer=True)
@GmfModel.register(wspd_range=[3., 80.], inc_range=[17., 50.], pol='VH', units='linear', defer=True)
def gmf_s1_v2(incidence, speed, phi=None):
"""
Sentinel-1 VH GMF : relation between sigma0, incidence and windspeed.
Expand Down Expand Up @@ -332,7 +332,6 @@ def gmf_rcm_noaa(incidence, speed, phi=None):
0.12713502524515713, 4.2806865431046752])

# Z1

a0_Z1 = Z1_p[0]
b0_Z1 = Z1_p[1]
b1_Z1 = Z1_p[2]
Expand All @@ -359,38 +358,3 @@ def gmf_rcm_noaa(incidence, speed, phi=None):
sigmoid_Z2 = 1 / (1 + np.exp(-c2*(speed-c3)))
sig_Final = sig_Z1 * sigmoid_Z1 + sig_Z2 * sigmoid_Z2
return sig_Final


def get_PR_Mouche1(inc_angle, wind_dir, wind_speed=None):
"""
Get the polarization ratio VV over HH using the Mouche model.
Alexis Mouche, D. Hauser, V. Kudryavtsev and JF. Daloze, "Multi polarization ocean radar cross-section
from ENVISAT ASAR observations, airborne polarimetric radar measurements and empirical or semi-empirical models",
ESA ERS/ENVISAT Symposium, Salzburg, September 2004
"""
# getRatioVVoverHH
theta = inc_angle
phi = wind_dir

A0 = 0.00650704
B0 = 0.128983
C0 = 0.992839
Api2 = 0.00782194
Bpi2 = 0.121405
Cpi2 = 0.992839
Api = 0.00598416
Bpi = 0.140952
Cpi = 0.992885

P0_theta = A0*np.exp(B0*theta)+C0
Ppi2_theta = Api2*np.exp(Bpi2*theta)+Cpi2
Ppi_theta = Api*np.exp(Bpi*theta)+Cpi

C0_theta = (P0_theta+Ppi_theta+2*Ppi2_theta)/4
C1_theta = (P0_theta-Ppi_theta)/2
C2_theta = (P0_theta+Ppi_theta-2*Ppi2_theta)/4

pr = C0_theta + C1_theta * \
np.cos(np.deg2rad(phi)) + C2_theta*np.cos(2*np.deg2rad(phi))

return pr
4 changes: 2 additions & 2 deletions src/xsarsea/windspeed/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def __init__(self, name, **kwargs):
self.resolution = kwargs.pop('resolution', None)

if not hasattr(self, 'inc_range'):
self.inc_range = [17., 50.]

# self.inc_range = [17., 50.]
self.inc_range = [16., 66.]
# steps for generated luts
self.inc_step_lr = kwargs.pop(
'inc_step_lr', 1.0)
Expand Down

0 comments on commit 4cb8e15

Please sign in to comment.