Sersic

class dysmalpy.models.Sersic(invq=1.0, noord_flat=False, baryon_type='gas+stars', **kwargs)[source]

Bases: MassModel, _LightMassModel

Mass distribution following a Sersic profile

Parameters:
  • total_mass (float) – Log10 of the total mass in solar units

  • r_eff (float) – Effective (half-light) radius in kpc

  • n (float) – Sersic index

  • invq (float) – Ratio of the effective radius to the effective radius in the z-direction

  • noord_flat (bool) – If True, use circular velocity profiles derived in Noordermeer 2008. If False, circular velocity is derived through v_circular

  • baryon_type ({'gas+stars', 'stars', 'gas'}) – What type of baryons are included. Used for dlnrhogas/dlnr

Notes

Model formula:

\[M(r) = M_e \exp \left\{ -b_n \left[ \left( \frac{r}{r_{\mathrm{eff}}} \right)^{1/n} -1 \right] \right\}\]

The constant \(b_n\) is defined such that \(r_{\mathrm{eff}}\) contains half the total mass, and can be solved for numerically.

\[\Gamma(2n) = 2\gamma (b_n,2n)\]

Examples

import numpy as np
from dysmalpy.models import Sersic
import matplotlib.pyplot as plt

plt.figure()
plt.subplot(111, xscale='log', yscale='log')
s1 = Sersic(total_mass=10, r_eff=5, n=1)
r=np.arange(0, 100, .01)

for n in range(1, 10):
     s1.n = n
     plt.plot(r, s1(r), color=str(float(n) / 15))

plt.axis([1e-1, 30, 1e5, 1e10])
plt.xlabel('log Radius [kpc]')
plt.ylabel('log Mass Surface Density [log Msun/kpc^2]')
plt.text(.25, 8.e7, 'n=1')
plt.text(.25, 3.e9, 'n=10')
plt.show()

(Source code, png, hires.png, pdf)

../_images/dysmalpy-models-Sersic-1.png

Attributes Summary

mass_to_light

n

noord_flat

param_names

Names of the parameters that describe models of this type.

r_eff

total_mass

tracer

Methods Summary

circular_velocity(r)

Circular velocity as a function of radius

dlnrhogas_dlnr(r)

Sersic asymmetric drift term

enclosed_mass(r)

Sersic enclosed mass (linear)

evaluate(r, total_mass, r_eff, n, mass_to_light)

Sersic mass surface density

light_profile(r)

Conversion from mass to light as a function of radius

projected_enclosed_mass(r)

rhogas(r)

Mass density as a function of radius (if noord_flat; otherwise surface density)

Attributes Documentation

mass_to_light = DysmalParameter('mass_to_light', value=1.0, fixed=True, prior=<dysmalpy.parameters.UniformPrior object>)
n = DysmalParameter('n', value=1.0, bounds=(0, 8), prior=<dysmalpy.parameters.UniformPrior object>)
noord_flat
param_names = ('total_mass', 'r_eff', 'n', 'mass_to_light')

Names of the parameters that describe models of this type.

The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.

When defining a custom model class the value of this attribute is automatically set by the Parameter attributes defined in the class body.

r_eff = DysmalParameter('r_eff', value=1.0, bounds=(0, 50), prior=<dysmalpy.parameters.UniformPrior object>)
total_mass = DysmalParameter('total_mass', value=1.0, bounds=(5, 14), prior=<dysmalpy.parameters.UniformPrior object>)
tracer = 'mass'

Methods Documentation

circular_velocity(r)[source]

Circular velocity as a function of radius

Parameters:

r (float or array) – Radii at which to calculate the enclosed mass

Returns:

vcirc – Circular velocity in km/s

Return type:

float or array

dlnrhogas_dlnr(r)[source]

Sersic asymmetric drift term

Parameters:

r (float or array) – Radius in kpc

Returns:

log_drhodr – Log surface density derivative as a function or radius

Return type:

float or array

enclosed_mass(r)[source]

Sersic enclosed mass (linear)

Parameters:

r (float or array) – Radii at which to calculate the enclosed mass

Returns:

menc – Enclosed mass profile

Return type:

float or array

static evaluate(r, total_mass, r_eff, n, mass_to_light)[source]

Sersic mass surface density

light_profile(r)[source]

Conversion from mass to light as a function of radius

Parameters:

r (float or array) – Radii at which to calculate the enclosed mass

Returns:

light – Relative line flux as a function of radius

Return type:

float or array

projected_enclosed_mass(r)[source]
rhogas(r)[source]

Mass density as a function of radius (if noord_flat; otherwise surface density)

Parameters:

r (float or array) – Radii at which to calculate the enclosed mass

Returns:

dens – Mass density at r in units of Msun/kpc^3 (if noord_flat; otherwise surface density)

Return type:

float or array