Saturday, January 19, 2013

Dust Absorption and Emission Spectra with Grasil

Galacticus can compute the spectrum of light emitted by stars in each model galaxy, and the resulting magnitude in any band. But, this spectrum accounts for absorption by dust in only a very simplistic way, and makes no accounting for re-emission of light from dust grains.

But, by coupling Galacticus with the Grasil code it's possible to compute  spectra of galaxies with a detailed model of dust extinction and re-emission, including the effects of a distribution of dust grain types and sizes, fluctuating grain temperatures, emission from polycyclic aromatic hydrocarbons (PAHs), and radio emission from supernova remnants.

We've recently made it much easier to perform these Galacticus+Grasil calculations in v0.9.2 of Galacticus, and added a short tutorial to the Galacticus documentation explaining how to do this.

Briefly, just add:

    <parameter>
      <name>starFormationHistoriesMethod</name>
      <value>metallicitySplit</value>
    </parameter>


to the Galacticus parameter file. This causes Galacticus to store the entire star formation history of each galaxy, as a function of time and metallicity. (The tutorial explains how to tune the details of how star formation histories are stored.) These star formation histories are used by Grasil to compute the emission arising from stellar populations of different ages.

Then, using Galacticus' standard analysis package, simply load the Galacticus::Grasil module and ask for a property such as "grasilFlux850microns", to get the flux (in Janskys) at any wavelength. An example code snippet to do this looks like:

use Galacticus::HDF5;
use Galacticus::Grasil;
.

.
.
my $galacticus;
$galacticus->{'file' } = "galacticus.hdf5";
$galacticus->{'store'} = 0;
$galacticus->{'tree' } = "all";
&HDF5::Get_Parameters        ($galacticus                         );
&HDF5::Select_Output         ($galacticus, 2.0                    );
&HDF5::Get_Datasets_Available($galacticus                         );
&HDF5::Get_Dataset           ($galacticus,['grasilFlux850microns']);


print $galacticus->{'dataSets'}->{'grasilFlux850microns'}."\n";

When this code is run, Grasil will be run (and automatically downloaded if necessary) on each galaxy. Where possible (i.e. if you have many cores available), multiple copies of Grasil will be run simultaneously. The full SED as a function of wavelength and inclination will be stored to the Galacticus model file for future use (which is convenient as Grasil models typically take tens of seconds to run), and the requested flux computed and returned.

Once SEDs have been computed in this way they can be extracted and examined. A simple plotting script (scripts/plotting/plotGrasilSpectrum.pl) is provided which makes plots like this:

which nicely shows the attenuated stellar emission at short wavelengths, PAH emission in the ~10um region, thermal emission from dust at ~100um and synchrotron emission above 1mm.

No comments:

Post a Comment