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:
cubendarray 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.

pathPath 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.

wcsWCS, optional

The WCS information to use for the cube. This should only be specified if the cube parameter is a plain ndarray instance.

spacingfloat

The position resolution in the final position-velocity slice. This can be given in pixel coordinates or as a Quantity instance 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 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.

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.

Returns:
slicePrimaryHDU

The position-velocity slice, as a FITS HDU object