Skip to content

Commit

Permalink
Avoid adding keyword arguments to with_mask
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Apr 9, 2020
1 parent 8848ce7 commit fae39fa
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spectral_cube/spectral_cube.py
Expand Up @@ -1132,7 +1132,7 @@ def percentile(self, q, axis=None, iterate_rays=False, **kwargs):

return result

def with_mask(self, mask, inherit_mask=True, wcs_tolerance=None, **kwargs):
def with_mask(self, mask, inherit_mask=True, wcs_tolerance=None):
"""
Return a new SpectralCube instance that contains a composite mask of
the current SpectralCube and the new ``mask``. Values of the mask that
Expand Down Expand Up @@ -1179,7 +1179,7 @@ def with_mask(self, mask, inherit_mask=True, wcs_tolerance=None, **kwargs):
new_mask._validate_wcs(new_data=self._data, new_wcs=self._wcs,
wcs_tolerance=wcs_tolerance or self._wcs_tolerance)

return self._new_cube_with(mask=new_mask, wcs_tolerance=wcs_tolerance, **kwargs)
return self._new_cube_with(mask=new_mask, wcs_tolerance=wcs_tolerance)

def __getitem__(self, view):

Expand Down Expand Up @@ -3971,12 +3971,10 @@ def mask_channels(self, goodchannels):
raise ValueError("goodchannels must have a length equal to the "
"cube's spectral dimension.")

mask = BooleanArrayMask(goodchannels[:,None,None], self._wcs,
shape=self._data.shape)

return self.with_mask(goodchannels[:,None,None],
goodbeams_mask=np.logical_and(goodchannels, self.goodbeams_mask))
cube = self.with_mask(goodchannels[:,None,None])
cube.goodbeams_mask = np.logical_and(goodchannels, self.goodbeams_mask)

return cube

def spectral_interpolate(self, *args, **kwargs):
raise AttributeError("VaryingResolutionSpectralCubes can't be "
Expand Down

0 comments on commit fae39fa

Please sign in to comment.