The SKIRT project
advanced radiative transfer for astrophysics
The SKIRT units system & supported units

Introduction

SKIRT supports a rich set of astronomical units for input and output purposes. Internally, however, SKIRT uses the International System of Units (SI) for all physical quantities. Furthermore, all spectral quantities are internally expressed in wavelength style, i.e. wavelength (m) or per wavelength (1/m). The conversion from input units to SI units occurs at input time, and the conversion from SI units to output units occurs at output time. In other words, the unit conversion code is isolated in specific input and output modules. This convention allows all other code to avoid unit conversions, thus simplifying the internal calculations.

Unit system configuration

To configure the default units employed for a simulation, the user first selects the UnitSystem subclass:

  • SI units: standard international units, i.e. m as the unit of length, distance, and wavelength, and kg as the unit of mass.
  • Stellar units: use AU as the unit of length, pc as the unit of distance, μm as the unit of wavelength, and M as the unit of mass.
  • Extragalactic units: use pc as the unit of length, Mpc as the unit of distance, μm as the unit of wavelength, and M as the unit of mass.

The UnitSystem class has two properties to then select the flavor of spectral quantities:

  • wavelengthOutputStyle: the output style of the spectral variable; i.e. photon Wavelength, photon Frequency, or photon Energy.
  • fluxOutputStyle: the output style of flux-related values such as spatially integrated flux density or surface brightness; i.e. Neutral ( λFλ=νFν), per unit of Wavelength ( Fλ), per unit of Frequency ( Fν) or counts per unit of Energy ( FE).

For example, selecting

<SIUnits wavelengthOutputStyle="Wavelength" fluxOutputStyle="Wavelength"/>

would output all quantities in internal form without conversion, e.g., distance and wavelength in m and surface brightness in W/m3/sr. On the other hand, a simulation of a galaxy in the optical-FIR spectral range may instead specify

<ExtragalacticUnits wavelengthOutputStyle="Wavelength" fluxOutputStyle="Frequency"/>

which would output distance in Mpc, wavelength in micron, and surface brightness in MJy/sr. As a final example, a simulation of a circumstellar system in the X-ray spectral range may specify

<StellarUnits wavelengthOutputStyle="Energy" fluxOutputStyle="Energy"/>

which would output distance in pc, wavelength in keV, and surface brightness in 1/s/cm2/keV/arcsec2.

Units for input and output

The unit system configuration in the SKIRT parameter file (/em ski file) determines the default units used for the simulation. The input/output modules handle units as follows:

  • All output files produced by the simulation use the configured default units. This includes the files produced by instruments and probes, the generated copy of the parameter file (_parameters.xml) and the log file (_log.txt).
  • In responses to the Q&A for configuring the ski file (in the terminal or in MakeUp), and for values in the ski file itself, one can use any of the units supported for the quantity under consideration.
  • In text column input files (e.g. defining an SED or listing source particles extracted from a hydrodynamical simulation), the structured column headers (see TextInFile) can specify any of the units supported for the quantity under consideration. If no headers are provided, the assumed units are determined by the class reading the input file, as described in the class documentation. In this case, the default units configured in the ski file are not used.

On the input side, different spectral flavors can usually be specified. For example, a "wavelength" can be expressed as a wavelength (e.g. in Angstrom), a frequency (e.g. in THz) or in energy units (e.g. in MeV). Similarly, a luminosity density can be expressed as a per wavelength (e.g. Lsun/micron), per frequency (e.g. erg/s/Hz) or per energy quantity (e.g. /s/keV).

Supported units

In ski files, in interactive Q&A mode, and in input file column headers, SKIRT recognizes various unit abbreviations for each type of physical quantity. The supported abbreviations are listed in the following table. Unit abbreviations of the form "1/xxx" can also be written without the leading "1". For example, "17 /cm" is equivalent to "17 1/cm". In all cases, remember to include a space between the number and the unit abbreviation.

Physical quantity Unit abbreviations
length or distance m, cm, mm, km, AU, pc, kpc, Mpc
wavelength m, cm, mm, micron, nm, Angstrom, pm
wavelength (as photon frequency) Hz, kHz, MHz, GHz, THz, PHz, EHz, ZHz
wavelength (as photon energy) J, eV, meV, keV, MeV, GeV
grainsize m, cm, mm, micron, nm, Angstrom
per grainsize 1/m, 1/cm, 1/mm, 1/micron, 1/nm, 1/Angstrom
cross section m2, cm2, mm2
volume m3, cm3, mm3, AU3, pc3
velocity m/s, cm/s, mm/s, km/s, km/h
acceleration m/s2, cm/s2, mm/s2, km/s2
mass kg, g, Msun, amu
bulk mass kg, g
bulk mass density kg/m3, g/cm3
mass surface density kg/m2, g/cm2, Msun/AU2, Msun/pc2
mass volume density kg/m3, g/cm3, Msun/AU3, Msun/pc3
mass rate kg/s, g/s, Msun/yr
number surface density 1/m2, 1/cm2, 1/AU2, 1/pc2
number volume density 1/m3, 1/cm3, 1/AU3, 1/pc3
mass coefficient m2/kg, cm2/g
time s, yr, Myr, Gyr
temperature K
energy J, erg, eV, meV, keV, MeV, GeV, TeV
magnetic field T, mT, uT, nT, G, mG, uG, nG
pressure Pa, N/m2, J/m3, bar, mbar, hPa, Ba, erg/cm3, K/m3
bolometric luminosity W, J/s, erg/s, Lsun
bolometric luminosity surface density W/m2, erg/s/cm2, Lsun/AU2, Lsun/pc2
bolometric luminosity volume density W/m3, erg/s/cm3, Lsun/AU3, Lsun/pc3
neutral monochromatic luminosity (λLλ=νLν) W, erg/s, Lsun
neutral monochromatic luminosity volume density (λLλ/V) W/m3, erg/s/cm3, Lsun/AU3, Lsun/pc3
neutral flux density (λFλ=νFν) W/m2, erg/s/cm2
neutral surface brightness (λfλ=νfν), mean intensity or spectral radiance (λJλ=νJν) W/m2/sr, W/m2/arcsec2, erg/s/cm2/sr, erg/s/cm2/arcsec2
per-wavelength monochromatic luminosity (Lλ) W/m, W/micron, W/Angstrom, erg/s/cm, erg/s/micron, erg/s/Angstrom, Lsun/micron
per-wavelength monochromatic luminosity volume density (Lλ/V) W/m4, W/micron/m3, W/Angstrom/m3, erg/s/cm4, erg/s/micron/cm3, Lsun/micron/AU3, Lsun/micron/pc3
per-wavelength flux density (Fλ) W/m3, W/m2/micron, W/m2/Angstrom, erg/s/cm3, erg/s/cm2/micron, erg/s/cm2/Angstrom
per-wavelength surface brightness (fλ), mean intensity or spectral radiance (Jλ) W/m3/sr, W/m2/micron/sr, W/m2/micron/arcsec2, W/m2/Angstrom/sr, W/m2/Angstrom/arcsec2, erg/s/cm3/sr, erg/s/cm2/micron/sr, erg/s/cm2/micron/arcsec2, erg/s/cm2/Angstrom/sr, erg/s/cm2/Angstrom/arcsec2
per-frequency monochromatic luminosity (Lν) W/Hz, erg/s/Hz, Lsun/Hz
per-frequency monochromatic luminosity volume density (Lν/V) W/Hz/m3, Lsun/Hz/AU3, Lsun/Hz/pc3
per-frequency flux density (Fν) W/m2/Hz, erg/s/cm2/Hz, Jy, mJy, MJy
per-frequency surface brightness (fν), mean intensity or spectral radiance (Jν) W/m2/Hz/sr, W/m2/Hz/arcsec2, erg/s/cm2/Hz/sr, erg/s/cm2/Hz/arcsec2, Jy/sr, Jy/arcsec2, MJy/sr, MJy/arcsec2
counts-per-energy monochromatic luminosity (LE) 1/s/J, 1/s/eV, 1/s/keV
counts-per-energy monochromatic luminosity volume density (LE/V) 1/s/J/m3, 1/s/eV/m3, 1/s/keV/m3, 1/s/keV/AU3, 1/s/keV/pc3
counts-per-energy flux density (FE) 1/s/m2/J, 1/s/cm2/keV
counts-per-energy surface brightness (fE), mean intensity or spectral radiance (JE) 1/s/m2/J/sr, 1/s/m2/J/arcsec2, 1/s/cm2/keV/sr, 1/s/cm2/keV/arcsec2
angular size (for objects in the sky) rad, deg, arcsec
positioning angle (for instruments) rad, deg
solid angle sr, arcsec2