Skip to content

Commit

Permalink
the new version of xarray has depreciated sel_points.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainp committed Sep 18, 2019
1 parent adc3cfa commit 7242f31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smrt/core/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ def sigma(self, **kwargs):
"""Return backscattering coefficient. Any parameter can be added to slice the results (e.g. frequency=37e9, polarization_inc='V', polarization='V').
See xarray slicing with sel method (to document)"""
if 'theta' in kwargs:
theta = np.atleast_1d(kwargs.pop('theta'))
theta = xr.DataArray(np.atleast_1d(kwargs.pop('theta')), dims=['theta'])
else:
theta = self.data.theta

backscatter = self.data.sel(**kwargs).sel_points(theta_inc=theta, theta=theta).rename({'points': 'theta'})
backscatter = self.data.sel(**kwargs).sel(theta_inc=theta, theta=theta)
return 4 * np.pi * _strongsqueeze(np.cos(np.radians(theta)) * backscatter)

def sigma_dB(self, **kwargs):
Expand Down

0 comments on commit 7242f31

Please sign in to comment.