API

dysmalpy.galaxy Module

Classes

Galaxy([z, cosmo, Om0, Tcmb0, Neff, m_nu, ...])

Container for simulating or modelling a galaxy

dysmalpy.models Package

Functions

surf_dens_exp_disk(r, mass, rd)

Radial surface density function for an infinitely thin exponential disk

menc_exp_disk(r, mass, rd)

Enclosed mass function for exponential disk

vcirc_exp_disk(r, mass, rd)

Rotation curve function for exponential disk

sersic_mr(r, mass, n, r_eff)

Radial surface mass density function for a generic sersic model

sersic_menc_2D_proj(r, mass, n, r_eff)

Enclosed mass as a function of r for a generic sersic model

v_circular(mass_enc, r)

Circular velocity given an enclosed mass and radius

menc_from_vcirc(vcirc, r)

Enclosed mass given a circular velocity and radius

Classes

ModelSet()

Object that contains all model components, parameters, and settings

Sersic([invq, noord_flat, baryon_type])

Mass distribution following a Sersic profile

DiskBulge([invq_disk, invq_bulge, ...])

Mass distribution with a disk and bulge

LinearDiskBulge([invq_disk, invq_bulge, ...])

Mass distribution with a disk and bulge

ExpDisk([baryon_type])

Infinitely thin exponential disk (i.e. Freeman disk).

BlackHole(**kwargs)

Central black hole.

GaussianRing([baryon_type])

Mass distribution following an infinitely thin Gaussian ring profile.

NFW([z, cosmo, Om0, Tcmb0, Neff, m_nu, Ob0])

Dark matter halo following an NFW profile

LinearNFW([z, cosmo, Om0, Tcmb0, Neff, ...])

Same as NFW except with the virial mass in linear units

TwoPowerHalo([z, cosmo, Om0, Tcmb0, Neff, ...])

Two power law density model for a dark matter halo

Burkert([z, cosmo, Om0, Tcmb0, Neff, m_nu, Ob0])

Dark matter halo following a Burkert profile

Einasto([z, cosmo, Om0, Tcmb0, Neff, m_nu, ...])

Dark matter halo following an Einasto profile

DekelZhao([z, cosmo, Om0, Tcmb0, Neff, ...])

Dekel-Zhao halo profile (Dekel et al. 2017, Freundlich et al. 2020).

BiconicalOutflow([profile_type])

Model for a biconical outflow

UnresolvedOutflow([vcenter, fwhm, amplitude])

Model for an unresolved outflow component described by a Gaussian

UniformRadialFlow(**kwargs)

Model for a uniform radial flow.

PlanarUniformRadialFlow(**kwargs)

Model for a planar uniform radial flow, with radial flow only in the plane of the galaxy.

AzimuthalPlanarRadialFlow([vr])

Model for a planar radial flow, with radial flow only in the plane of the galaxy,

UniformBarFlow(**kwargs)

Model for a uniform flow along a bar, along some axis in the galaxy midplane.

VariableXBarFlow([vbar])

Model for flow along a bar, along some axis in the galaxy midplane,

UniformWedgeFlow(**kwargs)

Model for a uniform planar radial flow (only in the plane of the galaxy),

SpiralDensityWave([Vrot, rho0, f, k, dVrot_dR])

Model for a spiral density wave, assumed in the galaxy midplane.

LightTruncateSersic([tracer])

Light distribution following a Sersic profile.

LightGaussianRing([tracer])

Light distribution following a Gaussian ring profile.

LightClump([tracer])

Light distribution for a clump following a Sersic profile, at a given galaxy midplane R and azimuthal angle phi.

LightGaussianRingAzimuthal([tracer])

Light distribution following a Gaussian ring profile, with azimuthal brightness variation.

DispersionConst([sigma0])

Model for a constant dispersion

ThinCentralPlaneDustExtinction([inc, pa, ...])

Model for extinction due to a thin plane of dust

ForegroundConstantExtinction([Alam])

Model for extinction due to a foreground plane of dust

ForegroundExponentialExtinction([Alam0, rd])

Model for extinction due to a foreground plane of dust

ConstantDimming([amp_lumtoflux])

Model for constant dimming.

CosmologicalDimming([z, cosmo, Om0, Tcmb0, ...])

Model for constant cosmological dimming.

Geometry([obs_name])

Model component defining the transformation from galaxy to sky coordinates

KinematicOptions([adiabatic_contract, ...])

Object for storing and applying kinematic corrections

ZHeightGauss(**kwargs)

Gaussian flux distribution in the z-direction

ZHeightExp(**kwargs)

Exponential flux distribution in the z-direction

NoordFlat([n, invq])

Class to handle circular velocities / enclosed mass profiles for a thick Sersic component.

InfThinMassiveGaussianRing([invh])

Class to handle circular velocities / enclosed mass profiles for an infinitely thin, massive Gaussian ring.

dysmalpy.instrument Module

Classes

Instrument([beam, beam_type, lsf, pixscale, ...])

Base class to define an instrument to observe a model galaxy.

GaussianBeam([major, minor, pa, area, ...])

Re-definition of radio_beam.Beam to allow it to work with copy.deepcopy and copy.copy.

DoubleBeam([major1, minor1, pa1, scale1, ...])

Beam object that is the superposition of two Gaussian Beams

Moffat([major_fwhm, minor_fwhm, pa, beta, ...])

Object describing a Moffat PSF

LSF([dispersion, default_unit, meta])

An object to handle line spread functions.

dysmalpy.data_classes Module

Classes

Data([data, error, weight, ndim, mask, ...])

Data1D(r, velocity[, vel_err, vel_disp, ...])

Convention:

Data2D(pixscale, velocity[, vel_err, ...])

Data3D(cube, pixscale, spec_type, spec_arr)

dysmalpy.aperture_classes Module

Functions

setup_aperture_types([obs, profile1d_type, ...])

Classes

Aperture([aper_center, nx, ny, ...])

Base Aperture class, containting a single aperture from which to extract a 1D spectrum and flux, velocity, and dispersion.

EllipAperture([slit_PA, pix_perp, ...])

Elliptical Aperture

RectAperture([slit_PA, pix_perp, ...])

Rectangular aperture.

Apertures([apertures, slit_PA, rotate_cube])

Base Aperture class, continaing a list/array of Aperture objects defining the full set of apertures for a kinematic observation.

EllipApertures([rarr, slit_PA, pix_perp, ...])

Set of elliptical apertures.

CircApertures([rarr, slit_PA, rpix, nx, ny, ...])

Set of circular apertures.

RectApertures([rarr, slit_PA, pix_perp, ...])

Set of rectangular apertures.

dysmalpy.fitting Package

Functions

reload_all_fitting([filename_galmodel, ...])

Utility to reload the Galaxy and Results object from a previous fit.

chisq_red(gal)

Evaluate reduced chi square of model, relative to the data.

chisq_eval(gal)

Evaluate chi square of model, relative to the data.

chisq_red_per_type(obs, nparams_free[, type])

Evaluate reduced chi square of the model velocity/dispersion/flux map/profile

setup_oversampled_chisq(gal)

Classes

MCMCFitter(**kwargs)

Class to hold the MCMC fitter attributes + methods

NestedFitter(**kwargs)

Class to hold the Nested sampling fitter attributes + methods

MPFITFitter(**kwargs)

Class to hold the MPFIT fitter attributes + methods

MCMCResults([model, sampler_results, ...])

Class to hold results of MCMC fitting to DYSMALPY models.

NestedResults([model, sampler_results, ...])

Class to hold results of nested sampling fitting to DYSMALPY models.

MPFITResults([model, blob_name])

Class to hold results of using MPFIT to fit to DYSMALPY models.

dysmalpy.plotting Module

Functions

plot_trace(bayesianResults[, fileout, overwrite])

Plot trace of Bayesian samples

plot_corner(bayesianResults[, gal, fileout, ...])

Plot corner plot of Bayesian result posterior distributions.

plot_bestfit(mcmcResults, gal[, ...])

Plot data, bestfit model, and residuals from the MCMC fitting.

dysmalpy.fitting_wrappers Package

dysmalpy.lensing Module

This is a Python code to implement lensing tranformation in DysmalPy. This code uses the C++ library libLensingTransformer.so.

Classes

LensingTransformer(mesh_file, mesh_ra, mesh_dec)

docstring for LensingTransformer

dysmalpy.parameters Module

Classes

DysmalParameter([name, description, ...])

New parameter class for dysmalpy based on Parameter

Prior()

Base class for priors

UniformPrior()

Object for flat priors

GaussianPrior([center, stddev])

Object for gaussian priors

BoundedGaussianPrior([center, stddev])

Object for Gaussian priors that only extend to a minimum and maximum value

BoundedGaussianLinearPrior([center, stddev])

BoundedSineGaussianPrior([center, stddev])

Object for priors described by a bounded sine Gaussian distribution

UniformLinearPrior()

ConditionalUniformPrior([f_bounds, f_cond])

Object for flat priors, but with boundaries that are conditional on other model parameters.

ConditionalEmpiricalUniformPrior([f_cond, ...])

Object for flat priors, but with boundaries that are conditional on other model parameters.

dysmalpy.utils Module

Functions

rebin(arr, new_2dshape)

calc_pixel_distance(nx, ny, center_coord)

Function to calculate the distance of each pixel from a specific pixel as well as the position angle

create_aperture_mask(nx, ny, center_coord, dr)

Function to create an aperture mask.

determine_aperture_centers(nx, ny, ...)

Determine the centers of the apertures that span an image/cube along a line with position angle pa and goes through center_coord.

calc_pix_position(r, pa, xcenter, ycenter)

Simple function to determine the pixel that is r away from (xcenter, ycenter) along a line with position angle (pa)

measure_1d_profile_apertures(cube, rap, pa, ...)

Measure the 1D rotation curve using equally spaced apertures along a defined axis

apply_smoothing_2D(vel, disp[, ...])

apply_smoothing_3D(cube[, smoothing_type, ...])

symmetrize_velfield(xbin, ybin, velBin, errBin)

This routine generates a bi-symmetric ('axisymmetric') version of a given set of kinematical measurements.

symmetrize_1D_profile(rin, vin, errin[, sym])

fit_truncated_gaussian(trace, truncate_value)

Find the best fitting mean and standard deviation of a sample assuming the distribution is a truncated Gaussian with the truncation occurring at low values.

lnlike_truncnorm(params, x)

fit_uncertainty_ellipse(chain_x, chain_y[, bins])

Get the uncertainty ellipse of the sample for each photocenter.

gaus_fit_sp_opt_leastsq(x, y, flux_guess, ...)

gaus_fit_apy_mod_fitter(x, y, flux_guess, ...)

get_cin_cout(shape[, asint])

citations()

Return the papers that should be cited when using DYSMALPY

dysmalpy.config Module

Classes

OutputOptions([outdir, save_model, ...])

Class to hold all options for file output during and after fitting