Dysmalpy

DysmalPy (DYnamical Simulation and Modelling ALgorithm in PYthon) is a Python-based forward modeling code designed for analyzing galaxy kinematics. It was originally inspired by Reinhard Genzel’s DISDYN program (e.g., Tacconi et al. 1994), has been developed and is maintained at the Max Planck Institute for Extraterrestrial Physics (MPE). It extends the IDL-based DYSMAL fitting models introduced and thoroughly tested in previous works (Davies et al. 2004a; Davies et al. 2004b; Cresci et al. 2009; Davies et al. 2011) as well as subsequent improvements described by Wuyts et al. 2016; Lang et al. 2017; Genzel et al. 2017; Übler et al. 2018. Its Python incarnation and latest developments and testing are presented by Price et al. 2021 and Lee et al. 2024, in prep.

This code employs a set of models that describe the mass distribution and various kinematic components to describe and fit the kinematics of galaxies. Dysmalpy has several features, which include support for multiple halo profiles, flexibility in modeling baryon components such as non-circular higher-order kinematic features, multi-observation fitting, the ability to tie model component parameters together and options for fitting using either least-squares minimization (with MPFIT), Markov chain Monte Carlo (MCMC) posterior sampling (with emcee) or dynamic nested sampling (with Dynesty).

Dysmalpy is specifically designed for the analysis of disk galaxies. The classification of a galaxy as a disk can be made following the set of 5 criteria outlined by Wisnioski et al. 2015; Sect. 4.1, motivated by expectations for ideal rotating disks and increasingly stringent and demanding of the data:

  • Smooth monotonic velocity gradient across the galaxy, defining the kinematic axis;

  • Centrally peaked velocity dispersion distribution with maximum at the position of steepest velocity gradient, defining the kinematic center;

  • Dominant rotational support, quantified by the ratio of \(v_{rot}/\sigma_0>1\);

  • Coaligned morphological and kinematic major axes;

  • Spatial coincidence of kinematic and morphological centers.

In practice, the first three criteria are essential. Importantly, in the context of the disk framework, the velocity dispersion \(\sigma_0\) used for this classification denotes the random motions within the disk component (corrected for spectral and spatial resolution), which relate to its geometrical thickness.

Dysmalpy is parametric in nature, allowing the direct fitting of the intrinsic galaxy properties, exploration of mass decomposition, dark matter fractions, and assessment of parameter degeneracies and associated uncertainties. This stands in contrast to a non-parametric kinematic fitting approach, which requires additional steps for interpreting recovered intrinsic galaxy kinematic properties.

The forward modeling process involves simulating the mass distribution of a galaxy, generating a 3D mock cube capturing composite kinematics, and accounting for observational effects such as beam smearing and instrumental line broadening. The model cube can be directly compared to the datacube in 3D, but it can also be compared to 1D or 2D kinematic observations by extracting the corresponding one or two-dimensional profiles following the same procedure that was used on the observed data. For detailed information, refer to the Appendix in Price et al. 2021 as well as Lee et al. 2024, in prep.

The overall basic usage of DYSMALPY can be summarised as follows:

  1. Setup steps: Import modules, set paths, define global constants and variables

  2. Initialise: Create a galaxy object with its corresponding parameters, add the model set (disk, bulge, DM halo, etc), and set up the observation and instrument information.

  3. Fitting: Perform fitting/bayesian sampling in either 1D, 2D, or 3D using either MPFIT, MCMC or dynamic nested sampling.

  4. Assess: Visualise, assess fit, and fine tune the fitting

We strongly recommend following and understanding the tutorials section of the main website. Alternatively, you can run and familiarize yourself with the jupyter notebooks in the notebooks folder (these will be included in your installation of dysmalpy under examples/notebooks).

Indices and tables