xdust.graindist.sizedist

The size distribution library is built on the superclass Sizedist, which holds the grain size distribution function and the grain size array.

The grain size distribution function is defined as the number of grains per unit volume per unit grain size, i.e. \(dn/da\).

Note

Within this library the functions are used to describe column density \(N(a) = \int dn/da \, dl\), where \(dl\) is the path length along the line of sight. However, one can always convert between column density and number density by dividing by the path length, i.e. \(n(a) = N(a)/L\).

Premade size distributions

Sizedist

class xdust.graindist.sizedist.Sizedist[source]

Bases: object

Abstract class for grain size distributions

dtype

String description of the size distribution.

Type:

str

a

Grain radius grid.

Type:

astropy.units.Quantity

mdens(md, rho, shape)[source]

Calculate mass density function for the dust grains, given a total dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere, the only supported option)

Returns:

Mass column distribution [g cm^-2 um^-1].

Return type:

numpy.ndarray

ndens(md, rho, shape)[source]

Calculate number density of dust grains, given a dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere, the only supported option)

Returns:

Column density of grains [cm^-2 um^-1].

Return type:

numpy.ndarray

Grain

class xdust.graindist.sizedist.Grain(rad=<Quantity 1. micron>)[source]

Bases: Sizedist

A single grain size distribution

Parameters:

rad (astropy.units.Quantity or float) – Grain radius; plain floats are assumed to be in microns.

a

Grain radius.

Type:

astropy.units.Quantity

dtype

'Grain'.

Type:

str

mdens(md, rho=3.0, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate dust mass distribution – in this case, no calculation needed because it is a single grain size.

Why do I have this function here? Mostly to preserve interoperability. Other distributions return a continuous function that can be integrated.

ndens(md, rho=3.0, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate number density of dust grains, given a dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Column density of grains [cm^-2].

Return type:

numpy.ndarray

Powerlaw

class xdust.graindist.sizedist.Powerlaw(amin=0.005, amax=0.3, p=3.5, na=24, log=True)[source]

Bases: Sizedist

A power law grain size distribution

Parameters:
  • amin (astropy.units.Quantity or float) – Minimum grain radius; plain floats are assumed to be in microns.

  • amax (astropy.units.Quantity or float) – Maximum grain radius; plain floats are assumed to be in microns.

  • p (float) – Power law slope for \(dn/da \propto a^{-p}\).

  • na (int) – Number of grain size grid points.

  • log (bool) – If True (default), use log-spaced grain size grid; otherwise, use a linear grid.

mdens(md, rho=3.0, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate mass density function for the dust grains, given a total dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Mass column distribution [g cm^-2 um^-1].

Return type:

numpy.ndarray

ndens(md, rho=3.0, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate number density of dust grains, given a dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Column density of grains [cm^-2 um^-1].

Return type:

numpy.ndarray

ExpCutoff

class xdust.graindist.sizedist.ExpCutoff(amin=0.005, acut=0.1, p=3.5, na=24, log=True, nfold=5)[source]

Bases: object

Power law grain size distribution with an exponential cut-off at the large end

Parameters:
  • amin (astropy.units.Quantity or float) – Minimum grain radius; plain floats are assumed to be in microns.

  • acut (astropy.units.Quantity or float) – Exponential cut-off grain radius; plain floats are assumed to be in microns.

  • p (float) – Power law slope for \(dn/da \propto a^{-p}\).

  • na (int) – Number of grain size grid points.

  • log (bool) – If True (default), use log-spaced grain size grid; otherwise, use a linear grid.

  • nfold (int) – Number of e-foldings past acut to extend the grid.

mdens(md, rho=3.0, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate mass density function for the dust grains, given a total dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Mass column distribution [g cm^-2 um^-1].

Return type:

numpy.ndarray

ndens(md, rho=3.0, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate number density of dust grains, given a dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Column density of grains [cm^-2 um^-1].

Return type:

numpy.ndarray

WD01

class xdust.graindist.sizedist.WD01(galaxy='MW', RV=3.1, form='silicate', amin=0.00035, amax=0.5, na=24, log=True)[source]

Bases: Sizedist

Weingartner & Draine (2001) grain size distribution

Parameters:
  • galaxy (str) – Name of the galaxy. Default 'MW'.

  • RV (float) – Total-to-selective extinction ratio. Default 3.1.

  • form (str) – Dust grain composition; 'silicate' or 'graphite'.

  • amin (astropy.units.Quantity or float) – Minimum grain radius; plain floats are assumed to be in microns.

  • amax (astropy.units.Quantity or float) – Maximum grain radius; plain floats are assumed to be in microns.

  • na (int) – Number of grain size bins.

  • log (bool) – If True (default), use log-spaced grain size grid; otherwise, use a linear grid.

Warning

This class has only been implmented for galaxy='MW' and RV values of 3.1, 4.0, and 5.5.

mdens(md, rho=None, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate mass density function for the dust grains, given a total dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float, optional) – Grain material density [g cm^-3]. If provided and different from self.rho, overrides the default density.

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Mass column distribution [g cm^-2 um^-1].

Return type:

numpy.ndarray

ndens(md, rho=None, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate number density of dust grains, given a dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float, optional) – Grain material density [g cm^-3]. If provided and different from self.rho, overrides the default density.

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Column density of grains [cm^-2 um^-1].

Return type:

numpy.ndarray

Astrodust

class xdust.graindist.sizedist.Astrodust(amin=0.00045, amax=1.0, na=24, log=True)[source]

Bases: Sizedist

The Astrodust grain size distribution accroding to Hensley & Draine 2022

Parameters:
  • amin (astropy.units.Quantity or float) – Minimum grain radius; plain floats are assumed to be in microns.

  • amax (astropy.units.Quantity or float) – Maximum grain radius; plain floats are assumed to be in microns.

  • na (int) – Number of grain size grid points.

  • log (bool) – If True (default), use a log-spaced grain size grid; otherwise, use a linear grid.

mdens(md, rho=3.0, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate mass density function for the dust grains, given a total dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Mass column distribution [g cm^-2 um^-1].

Return type:

numpy.ndarray

ndens(md, rho=3.0, shape=<xdust.graindist.shape.sphere.Sphere object>)[source]

Calculate number density of dust grains, given a dust mass column

Parameters:
  • md (float) – Mass column density [g cm^-2].

  • rho (float) – Grain material density [g cm^-3].

  • shape (xdust.graindist.shape object) – Grain shape (default: Sphere).

Returns:

Column density of grains [cm^-2 um^-1].

Return type:

numpy.ndarray