Skip to content

Commit

Permalink
nrcs = nan|0 => windspeed = nan
Browse files Browse the repository at this point in the history
  • Loading branch information
vincelhx committed May 16, 2024
1 parent b5c7b47 commit feae0b6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/xsarsea/windspeed/windspeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def invert_from_model(inc, sigma0, sigma0_dual=None, /, ancillary_wind=None, dsi
nan = sigma0 * np.nan

#  put nan values where sigma0 is nan or 0
#  sigma0 = np.where(sigma0 == 0, np.nan, sigma0)
#  if sigma0_dual is not None:
# sigma0 = np.where(sigma0 == 0, np.nan, sigma0)
# if sigma0_dual is not None:
# sigma0_dual = np.where(sigma0_dual == 0, np.nan, sigma0_dual)

if not isinstance(model, tuple):
Expand Down Expand Up @@ -185,8 +185,7 @@ def __invert_from_model_1d(inc_1d, sigma0_co_db_1d, sigma0_cr_db_1d, dsig_cr_1d,
if np.isnan(one_inc):
out_co[i] = np.nan
out_cr[i] = np.nan
continue

continue

if not np.isnan(one_sigma0_co_db):
# copol inversion available
Expand Down Expand Up @@ -223,7 +222,8 @@ def __invert_from_model_1d(inc_1d, sigma0_co_db_1d, sigma0_cr_db_1d, dsig_cr_1d,

else:
# no copol. use ancillary wind as wspd_co (if available)
wind_co = one_ancillary_wind
# wind_co = one_ancillary_wind
wind_co = np.nan * 1j

if not np.isnan(one_sigma0_cr_db) and not np.isnan(one_dsig_cr):
# crosspol available, do dualpol inversion
Expand Down Expand Up @@ -257,6 +257,7 @@ def __invert_from_model_1d(inc_1d, sigma0_co_db_1d, sigma0_cr_db_1d, dsig_cr_1d,

out_co[i] = wind_co
out_cr[i] = wind_dual

return None

# build a vectorized function from __invert_from_gmf_scalar
Expand Down

0 comments on commit feae0b6

Please sign in to comment.