Capivara implements a spectral-based segmentation method for Integral Field Unit (IFU) data cubes. Designed with astronomers in mind, it facilitates the decomposition of spectral data into regions of similar physical properties, leveraging advanced matrix operations via torch for GPU acceleration.
Install Capivara from GitHub using the following commands:
install.packages('remotes')
remotes::install_github("RafaelSdeSouza/capivara")
library(capivara)
This example demonstrates how to use capivara to process an IFU datacube from the MaNGA survey:
require(capivara)
# Read the MaNGA datacube
cube <- "manga-7443-12703-LOGCUBE.fits"
# Apply Capivara segmentation
res <- capivara::segment(cube,Ncomp=20)
# Plot the segmented region
plot <- plot_cluster(res)
print(plot)
For more information, check the Capivara GitHub webpage.