extract_pv_slice¶
- pvextractor.extract_pv_slice(cube, path, wcs=None, spacing=1.0, order=3, respect_nan=True, assert_square=True)[source]¶
Given a position-position-velocity cube with dimensions (nv, ny, nx), and a path, extract a position-velocity slice.
- Alternative implementations:
gipsy::sliceview karma::kpvslice casaviewer::slice
- Parameters:
- cube
ndarrayorSpectralCubeor str or HDU The cube to extract a slice from. If this is a plain
ndarrayinstance, the WCS information can optionally be specified with thewcsparameter. If a string, it should be the name of a file containing a spectral cube.- path
Pathor list of 2-tuples The path along which to define the position-velocity slice. The path can contain coordinates defined in pixel or world coordinates.
- wcs
WCS, optional The WCS information to use for the cube. This should only be specified if the
cubeparameter is a plainndarrayinstance.- spacingfloat
The position resolution in the final position-velocity slice. This can be given in pixel coordinates or as a
Quantityinstance with angle units.- orderint, optional
Spline interpolation order when using paths with zero width. Does not have any effect for paths with a non-zero width.
- respect_nanbool, optional
If set to
False, NaN values are changed to zero before computing the slices. If set toTrue, in the case of line paths a second computation is performed to ignore the NaN value while interpolating, and set the output values of NaNs to NaN.- assert_squarebool
If True, the WCS-loader will check whether the pixels are square. If the pixels are not square, the interpretation of the X-axis in the extracted PV diagram is ambiguous. In some cases, it may be necessary to disable this check, though.
- cube
- Returns:
- slice
PrimaryHDU The position-velocity slice, as a FITS HDU object
- slice