diff --git a/src/xsarsea/windspeed/cmod7.py b/src/xsarsea/windspeed/cmod7.py index 33876ef..e818563 100644 --- a/src/xsarsea/windspeed/cmod7.py +++ b/src/xsarsea/windspeed/cmod7.py @@ -56,9 +56,6 @@ def _raw_lut(self, **kwargs): final_dims = ['incidence', 'wspd', 'phi'] coords = {'incidence': inc, 'phi': phi, 'wspd': wspd} - self.wspd_step = 0.2 - self.inc_step = 0.2 - self.phi_step = 1 self.wspd_range = self.wspd_range_lr self.inc_range = self.inc_range_lr self.phi_range = self.phi_range_lr diff --git a/src/xsarsea/windspeed/models.py b/src/xsarsea/windspeed/models.py index 1e3c9e1..390fe26 100644 --- a/src/xsarsea/windspeed/models.py +++ b/src/xsarsea/windspeed/models.py @@ -40,9 +40,9 @@ def __init__(self, name, **kwargs): self.wspd_step_lr = kwargs.pop('wspd_step_lr', 0.4) self.phi_step_lr = kwargs.pop('phi_step_lr', 2.5) - self.inc_step = kwargs.pop('inc_step', 0.2) - self.wspd_step = kwargs.pop('wspd_step', 0.2) - self.phi_step = kwargs.pop('phi_step', 2) + self.inc_step = kwargs.pop('inc_step', 0.1) + self.wspd_step = kwargs.pop('wspd_step', 0.1) + self.phi_step = kwargs.pop('phi_step', 1) self.__class__._available_models[name] = self diff --git a/src/xsarsea/windspeed/windspeed.py b/src/xsarsea/windspeed/windspeed.py index bf7940f..ca13510 100644 --- a/src/xsarsea/windspeed/windspeed.py +++ b/src/xsarsea/windspeed/windspeed.py @@ -182,13 +182,22 @@ def __invert_from_model_1d(inc_1d, sigma0_co_db_1d, sigma0_cr_db_1d, dsig_cr_1d, one_sigma0_cr_db = sigma0_cr_db_1d[i] one_dsig_cr = dsig_cr_1d[i] one_ancillary_wind = ancillary_wind_1d[i] + + #  if incidence is NaN ; all output is NaN if np.isnan(one_inc): out_co[i] = np.nan out_cr[i] = np.nan continue + #  if ancillary is NaN, copol & dualpol are NaN + if (not np.isnan(np.abs(one_sigma0_co_db)) and np.isnan(np.abs(one_ancillary_wind))): + out_co[i] = np.nan + out_cr[i] = np.nan + continue + if not np.isnan(one_sigma0_co_db): # copol inversion available + i_inc = np.argmin(np.abs(np_inc_dim-one_inc)) np_sigma0_co_lut_db_inc = np_sigma0_co_lut_db[:, :, i_inc]