Elsevier

Astronomy and Computing

Volume 9, March 2015, Pages 20-33
Astronomy and Computing

Full length article
SKIRT: An advanced dust radiative transfer code with a user-friendly architecture

https://doi.org/10.1016/j.ascom.2014.10.004Get rights and content

Abstract

We discuss the architecture and design principles that underpin the latest version of SKIRT, a state-of-the-art open source code for simulating continuum radiation transfer in dusty astrophysical systems, such as spiral galaxies and accretion disks. SKIRT employs the Monte Carlo technique to emulate the relevant physical processes including scattering, absorption and emission by the dust. The code features a wealth of built-in geometries, radiation source spectra, dust characterizations, dust grids, and detectors, in addition to various mechanisms for importing snapshots generated by hydrodynamical simulations. The configuration for a particular simulation is defined at run-time through a user-friendly interface suitable for both occasional and power users. These capabilities are enabled by careful C++ code design. The programming interfaces between components are well defined and narrow. Adding a new feature is usually as simple as adding another class; the user interface automatically adjusts to allow configuring the new options. We argue that many scientific codes, like SKIRT, can benefit from careful object-oriented design and from a friendly user interface, even if it is not a graphical user interface.

Introduction

The presence of even a small fraction of dust can have a substantial impact on the radiation traversing and exiting an astrophysical system. In a typical spiral galaxy viewed edge-on, for example, the central dust lane blocks most of the starlight in the UV and optical wavelength range and re-emits the absorbed energy in the infrared and sub-millimeter regime (e.g.  Verstappen et al., 2013). Simulating the precise effect of the dust is not trivial. Anisotropic scattering by the dust couples all lines of sight, and dust absorption/emission couples all wavelengths. As a result, the radiative transfer equation is highly nonlocal and nonlinear (Steinacker et al., 2013). In most astrophysical systems, at least part of the dust is not in local thermal equilibrium with the radiation field, complicating the calculations even more (Draine and Li, 2001). And finally, realistic scenarios involve complex 3D geometries such as spiral arms, randomly placed clumps, or snapshots taken from a hydrodynamical simulation.

Because of these complexities, most dust radiative transfer codes use the Monte Carlo technique to tackle the problem; see e.g. the reviews by  Whitney (2011) and  Steinacker et al. (2013). The radiation field is represented as a stream of discrete photon packages. A simulation follows the individual path of each photon package through the dusty medium. The trajectory is governed by various events determined statistically by drawing random numbers from the appropriate probability distribution. Typically, a photon package is emitted, undergoes a number of scattering events, and is finally either absorbed or leaves the system. The Monte Carlo technique is conceptually simple and allows efficient radiative transfer calculations for complex problems. However, due to the randomization process, the results inherently contain a certain level of Poisson noise.

SKIRT is a state-of-the-art Monte Carlo dust radiative transfer code. It implements the common optimization techniques, such as peel-off at emission and scattering events (Yusef-Zadeh et al., 1984), continuous absorption (Lucy, 1999, Niccolini et al., 2003), and forced scattering (Cashwell and Everett, 1959), and includes novel techniques such as the library mechanism described in  Baes et al. (2011). The code is registered in the Astrophysics Source Code Library with identifier ascl:1109.003. Earlier versions were described in  Baes et al., 2003, Baes et al., 2011. Here we present the latest, substantially revised version of SKIRT, which is fully documented1 and publicly available from a GitHub code repository.2

Stalevski et al. (2012) have used SKIRT to investigate the emission of active galactic nuclei (AGN) dusty tori in the infrared domain, modeling the dusty torus as a two-phase medium with high-density clumps and a low-density medium filling the space between the clumps. The resulting SED database has been made public as described in  Stalevski (2012). As can be expected, SKIRT is often used to solve the inverse radiative transfer problem, where the goal is to recover the actual 3D distribution of radiation sources and dust by fitting the results of radiative transfer simulations to observational data. This is a nontrivial task, since the underlying model typically has a large number of free parameters. For example, SKIRT has been used to perform detailed studies of the dust energy balance in the edge-on spiral galaxies UGC4754, NGC 4565, and M104 (Baes et al., 2010, De Looze et al., 2012a, De Looze et al., 2012b). These studies found an inconsistency in the dust energy budget, suggesting that a sizable fraction of the total dust reservoir consists of a clumpy distribution with no associated young stellar sources.

Rather than using a manual trial and error procedure,  De Geyter et al. (2013) describe FitSKIRT, a code that automatically fits a 3D model to observed images of a dusty galaxy by matching the output of SKIRT radiative transfer simulations to the data. They apply FitSKIRT to automatically determine the intrinsic distribution of stars and dust in the galaxy NGC 4013.  De Geyter et al. (2014) use FitSKIRT to investigate interstellar dust in a sample of 12 edge-on galaxies, simultaneously reproducing the g-, r-, i- and z-band observations from a model with 19 free parameters without human intervention.

In this article, we do not discuss the results obtained with SKIRT, nor the Monte Carlo radiative transfer techniques implemented in the code. Instead we focus on the software design choices involved with setting up the simulation model. Many scientific codes require a user to hard-code the model makeup for each distinct problem. In contrast, our strategy with SKIRT in recent years has been to continuously add new features without removing existing capabilities. Consequently, SKIRT now offers a wealth of configurable components that are ready to use without any programming at all, especially in the areas where the code has been most often applied. An ad-hoc approach to include all of this functionality would have lead to source code that is hard to understand, maintain, and use. Instead we developed a modular, generic software architecture that can support the wide range of built-in components and options in SKIRT in a developer- and user-friendly way.

In Section  2 we first provide an overview of SKIRT’s features, including the user interface for configuring a particular simulation. In Section  3 we then discuss the design goals for the latest revision of the code, we describe the overall architecture, and we zoom in on a few key aspects of the design, such as the mechanism that automatically adjusts the user interface to accommodate new features. In Section  4 we finally argue that many scientific codes, like SKIRT, can benefit from careful object-oriented design and from a friendly user interface, even if it is not a graphical user interface.

Section snippets

Overview

SKIRT is a Monte Carlo continuum radiative transfer code for simulating the effect of dust on radiation in static astrophysical systems. It is assumed that the radiation traverses the system much faster than the time scale on which the system evolves. SKIRT offers full treatment of absorption and multiple anisotropic scattering by the dust, computes the temperature distribution of the dust and the thermal dust re-emission self-consistently, and supports stochastic heating of small grains using

Architecture

The latest version of SKIRT was re-architected with the following major design goals in mind:

  • Structured parameter file: use a self-documenting ski file format that supports the complex configuration needs described above in a user-friendly manner.

  • Single point of definition: define all information relating to a new feature only once and in the same place, including the code, the human-readable text strings used in the query and answer session, and the tags in the ski file.

  • Data-driven user

Conclusions

We described the major features of SKIRT, a state-of-the-art Monte Carlo dust radiative transfer simulation code used to study spiral galaxies, accretion disks and other astrophysical systems. In addition to its core capability of tracing the radiation through the dust, SKIRT offers a large number of built-in options for configuring all aspects of the simulation model, including spatial and spectral distributions, dust grain characterizations, simulated detection systems, and discretization.

Acknowledgments

This work fits in the CHARM framework (Contemporary physical challenges in Heliospheric and AstRophysical Models), a phase VII Interuniversity Attraction Pole (IAP) program organized by BELSPO, the BELgian federal Science Policy Office.

SKIRT and FitSKIRT are based on the Qt development framework and use the core Qt libraries for run-time class introspection, parallelization, string and container handling, and more. The code further incorporates the following third-party software libraries:

References (54)

  • M. Baes et al.

    Radiative transfer in disc galaxies — III. The observed kinematics of dusty disc galaxies

    Mon. Not. R. Astron. Soc.

    (2003)
  • M. Baes et al.

    Herschel-ATLAS: The dust energy balance in the edge-on spiral galaxy UGC 4754

    Astron. Astrophys.

    (2010)
  • M. Baes et al.

    Efficient Three-dimensional NLTE dust radiative transfer with SKIRT

    Astrophys. J. Suppl. Ser.

    (2011)
  • G. Bruzual et al.

    Stellar population synthesis at the resolution of 2003

    Mon. Not. R. Astron. Soc.

    (2003)
  • P. Camps et al.

    Using 3D voronoi grids in radiative transfer simulations

    Astron. Astrophys.

    (2013)
  • M. Cappellari

    Efficient multi-Gaussian expansion of galaxies

    Mon. Not. R. Astron. Soc.

    (2002)
  • E.D. Cashwell et al.

    A practical manual on the Monte Carlo method for random walk problems

  • L. Ciotti et al.

    Analytical properties of the R1/m law

    Astron. Astrophys.

    (1999)
  • M. Compiègne et al.

    The global dust SED: tracing the nature and evolution of dust with DustEM

    Astron. Astrophys.

    (2011)
  • G. De Geyter et al.

    The distribution of interstellar dust in CALIFA edge-on galaxies via oligochromatic radiative transfer fitting

    Mon. Not. R. Astron. Soc.

    (2014)
  • G. De Geyter et al.

    FitSKIRT: genetic algorithms to automatically fit dusty galaxies with a Monte Carlo radiative transfer code

    Astron. Astrophys.

    (2013)
  • I. De Looze et al.

    The dust energy balance in the edge-on spiral galaxy NGC 4565

    Mon. Not. R. Astron. Soc.

    (2012)
  • I. De Looze et al.

    Panchromatic radiative transfer modelling of stars and dust in the Sombrero galaxy

    Mon. Not. R. Astron. Soc.

    (2012)
  • W. Dehnen

    A family of potential-density pairs for spherical galaxies and bulges

    Mon. Not. R. Astron. Soc.

    (1993)
  • H. Dejonghe

    A completely analytical family of anisotropic Plummer models

    Mon. Not. R. Astron. Soc.

    (1987)
  • B.T. Draine et al.

    Infrared emission from interstellar dust. i. stochastic heating of small grains

    Astrophys. J.

    (2001)
  • B.T. Draine et al.

    Infrared emission from interstellar dust. iv. the silicate-graphite-PAH model in the post-spitzer era

    Astrophys. J.

    (2007)
  • J. Einasto

    On the construction of a composite model for the galaxy and on the determination of the system of galactic parameters

    Trudy Astrofizicheskogo Instituta Alma-Ata

    (1965)
  • E. Emsellem et al.

    The multi-gaussian expansion method: a tool for building realistic photometric and kinematical models of stellar systems I. the formalism

    Astron. Astrophys.

    (1994)
  • D. Fabian et al.

    Steps toward interstellar silicate mineralogy. VI. dependence of crystalline olivine IR spectra on iron content and particle shape

    Astron. Astrophys.

    (2001)
  • M. Fioc et al.

    PEGASE: a UV to NIR spectral evolution model of galaxies. application to the calibration of bright galaxy counts

    Astron. Astrophys.

    (1997)
  • E. Gamma et al.

    Design Patterns: Elements of Reusable Object-Oriented Software

    (1994)
  • G.L. Granato et al.

    Thick tori around active galactic nuclei — a comparison of model predictions with observations of the infrared continuum and silicate features

    Mon. Not. R. Astron. Soc.

    (1994)
  • B. Groves et al.

    Modeling the pan-spectral energy distribution of starburst galaxies. iv. the controlling parameters of the starburst SED

    Astrophys. J. Suppl. Ser.

    (2008)
  • C. Jaeger et al.

    Steps toward interstellar silicate mineralogy. IV. the crystalline revolution

    Astron. Astrophys.

    (1998)
  • R.L. Kurucz

    Model atmospheres (Kurucz, 1979)

    VizieR Online Data Catalog

    (1993)
  • C. Leitherer et al.

    Starburst99: synthesis models for galaxies with active star formation

    Astrophys. J. Suppl. Ser.

    (1999)
  • This code is registered at the ASCL with the code entry ascl:1109.003.

    View full text