Skip to content

Commit

Permalink
Add da.Array as accepted type for masks in low dim objects
Browse files Browse the repository at this point in the history
  • Loading branch information
e-koch committed Nov 19, 2020
1 parent 6e86c8a commit 612326f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spectral_cube/lower_dimensional_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _initial_set_mask(self, mask):
if mask is None:
mask = BooleanArrayMask(np.ones_like(self.value, dtype=bool),
self._wcs, shape=self.value.shape)
elif isinstance(mask, np.ndarray):
elif isinstance(mask, np.ndarray) or isinstance(mask, da.Array):
if mask.shape != self.value.shape:
raise ValueError("Mask shape must match the {0} shape."
.format(self.__class__.__name__)
Expand Down

0 comments on commit 612326f

Please sign in to comment.