StokesSpectralCube

class spectral_cube.StokesSpectralCube(stokes_data, mask=None, meta=None, fill_value=None)[source]

Bases: object

A class to store a spectral cube with multiple Stokes parameters.

The individual Stokes cubes can share a common mask in addition to having component-specific masks.

Attributes Summary

components

mask

The underlying mask

read

shape

stokes_data

The underlying data

wcs

write

Methods Summary

with_mask(mask[, inherit_mask])

Return a new StokesSpectralCube instance that contains a composite mask of the current StokesSpectralCube and the new mask.

with_spectral_unit(unit, **kwargs)

Attributes Documentation

components
mask

The underlying mask

read = <spectral_cube.io.core.StokesSpectralCubeRead object>
shape
stokes_data

The underlying data

wcs
write = <spectral_cube.io.core.StokesSpectralCubeWrite object>

Methods Documentation

with_mask(mask, inherit_mask=True)[source]

Return a new StokesSpectralCube instance that contains a composite mask of the current StokesSpectralCube and the new mask.

Parameters:
maskMaskBase instance, or boolean numpy array

The mask to apply. If a boolean array is supplied, it will be converted into a mask, assuming that True values indicate included elements.

inherit_maskbool (optional, default=True)

If True, combines the provided mask with the mask currently attached to the cube

Returns:
new_cubeStokesSpectralCube

A cube with the new mask applied.

Notes

This operation returns a view into the data, and not a copy.

with_spectral_unit(unit, **kwargs)[source]