Skip to content

Commit

Permalink
Merge pull request #532 from e-koch/vrsc_beams_slicing
Browse files Browse the repository at this point in the history
Fix VRSC -> VRODS slicing
  • Loading branch information
keflavich authored Feb 22, 2019
2 parents 29cbdd0 + fdc2ba2 commit f65c335
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spectral_cube/spectral_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -3444,7 +3444,7 @@ def __getitem__(self, view):
spectral_unit=self._spectral_unit,
mask=self.mask[view],
meta=meta,
goodbeams_mask=self.goodbeams_mask
goodbeams_mask=self.goodbeams_mask[specslice]
if hasattr(self, '_goodbeams_mask')
else None,
**bmarg
Expand Down
12 changes: 12 additions & 0 deletions spectral_cube/tests/test_spectral_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,18 @@ def test_multibeam_slice():
np.testing.assert_almost_equal(flatslice.header['BMAJ'],
(0.1/3600.))

# Test returning a VRODS

spec = cube[:, 0, 0]

assert (cube.beams == spec.beams).all()

# And make sure that Beams gets slice for part of a spectrum

spec_part = cube[:1, 0, 0]

assert cube.beams[0] == spec.beams[0]

def test_basic_unit_conversion():

cube, data = cube_and_raw('advs.fits')
Expand Down

0 comments on commit f65c335

Please sign in to comment.