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
The underlying mask
The underlying data
Defines the type of stokes that has been setup.
stokes_type
can be sky, linear, circular, generic, or other.Methods Summary
transform_basis
([stokes_basis])The goal of this function is to transform the stokes basis of the cube to the one specified if possible.
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
- stokes_type¶
- Defines the type of stokes that has been setup.
stokes_type
can be sky, linear, circular, generic, or other. Sky
refers to stokes in sky basis, I,Q,U,VLinear
refers to the stokes in linear feed basis, XX, XY, YX, YYCircular
refers to stokes in circular feed basis, RR, RL, LR, LLGeneric
refers to the general four orthogonal components, PP, PQ, QP, QQ
- Defines the type of stokes that has been setup.
- wcs¶
- write = <spectral_cube.io.core.StokesSpectralCubeWrite object>¶
Methods Documentation
- transform_basis(stokes_basis='')[source]¶
The goal of this function is to transform the stokes basis of the cube to the one specified if possible. In principle one needs at least two related stokes of a given basis for the transformation to be possible. At this moment we are limiting it to the cases where all four stokes parameters in a given basis be available within the cube. The transformations are as follows Linear to Sky I = (XX + YY) / 2 Q = (XX - YY) / 2 U = (XY + YX) / 2 V = 1j(XY - YX) / 2
Circular to Sky I = (RR + LL) / 2 Q = (RL + LR) / 2 U = 1j*(RL - LR) / 2 V = (RR - LL) / 2
- 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
- mask
MaskBase
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
- mask
- Returns
- new_cube
StokesSpectralCube
A cube with the new mask applied.
- new_cube
Notes
This operation returns a view into the data, and not a copy.