# extract_pv_slice¶

pvextractor.extract_pv_slice(cube, path, wcs=None, spacing=1.0, order=3, respect_nan=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 : ndarray or SpectralCube or str or HDU The cube to extract a slice from. If this is a plain ndarray instance, the WCS information can optionally be specified with the wcs parameter. If a string, it should be the name of a file containing a spectral cube. path : Path or 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 cube parameter is a plain ndarray instance. spacing : float The position resolution in the final position-velocity slice. This can be given in pixel coordinates or as a Quantity instance with angle units. order : int, optional Spline interpolation order when using paths with zero width. Does not have any effect for paths with a non-zero width. respect_nan : bool, optional If set to False, NaN values are changed to zero before computing the slices. If set to True, 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. slice : PrimaryHDU The position-velocity slice, as a FITS HDU object