convolve_sky_byfactor#

mufasa.UltraCube.convolve_sky_byfactor(cube, factor, savename=None, **kwargs)[source]#

Convolve the spatial dimensions of a spectral cube by a specified factor.

This function reduces the spatial resolution of the input cube by convolving it with a Gaussian kernel scaled by the given factor. The resulting cube can optionally be saved to disk.

Parameters:
  • cube (SpectralCube) – The input spectral cube to be convolved. Must be an instance of spectral_cube.SpectralCube.

  • factor (int) – The factor by which to reduce the spatial resolution. A factor of 2 doubles the beam size, effectively halving the spatial resolution.

  • savename (str, optional) – The file path to save the convolved cube. If None, the convolved cube is not saved. Default is None.

  • **kwargs (dict, optional) – Additional keyword arguments passed to the convolution function (e.g., to customize the kernel or handle edge cases).

Returns:

convolved_cube – The convolved spectral cube with reduced spatial resolution.

Return type:

SpectralCube

Notes

  • Convolution is performed only on the spatial dimensions of the cube.

  • The kernel size is determined automatically based on the specified factor.

  • This function can be computationally intensive for large cubes. Consider using memory-efficient techniques if applicable.

Raises:
  • ValueError – If the input cube is not compatible with the convolution operation or if the specified factor is invalid.

  • IOError – If an error occurs while saving the convolved cube to the specified path.