QubeSpec
QubeSpec is a simple but powerful python package to fit optical astronomical spectra and more importantly analysing IFS cube from JWST/NIRSpec, JWST/MIRI, VLT/KMOS and VLT/SINFONI. The code has built models for fitting Halpha, [OIII], Hbeta, [SII] and [NII] of galaxies, galaxies with outflows, Type-1 AGN and Quasars.
Authors: Jan Scholtz, Francesco D’Eugenio and Ignas Juodžbalis
What can QubeSpec do?
QubeSpec takes you from a raw IFS data cube to science-ready emission-line maps:
Load cubes from JWST/NIRSpec IFU, JWST/MIRI, VLT/KMOS, VLT/SINFONI and VLT/FLAMES-ARGUS.
Prepare the cube: mask bad pixels/spikes, subtract the background (source-extractor based, or a supplied mask), PSF-match all wavelength channels, and extract a 1D spectrum from an aperture.
Fit a 1D spectrum with the pre-built models for Halpha+[NII]+[SII], [OIII]+Hbeta (with optional FeII template), Halpha+[OIII] jointly, or the full optical line list - each with narrow-only, outflow, and single/broad-line-region (BLR) variants. You can also fit any function of your own via
fitting_general, or describe a custom set of lines declaratively withQubeSpec.Models.Custom_model.general_model(see 1D fitting) instead of hand-writing one.Fit spaxel-by-spaxel using the same models (or your own), in parallel across CPUs, then post-process the results into flux/velocity/FWHM maps (see Spaxel-by-Spaxel fitting).
Inspect the results interactively with the
QubeSpec.Visualizationsviewer.
Fitting uses emcee throughout, giving full posterior chains (and hence proper uncertainties) for
every fitted quantity, not just a point estimate.
Source and installation
QubeSpec is developed at GitHub, and should be downloaded or pulled from there. Then, from inside your working directory, run (works on bash, untested on tcsh)
conda create -n qubespec python=3.10
conda activate qubespec
pip3 install QubeSpec/.
You should then be able to import QubeSpec in python as:
import QubeSpec
Getting started
The best place to get started is by looking at the iPython notebook examples. The full tutorial is in:
Loading a cube: For Loading the IFS cube into QubeSpec and preparing it to fit
1D fitting: Explanation of how fitting works.
Spaxel-by-Spaxel fitting: Fitting every spaxel in the cube.
Acknowledgements
Loads of people.