Version 56 (modified by peter, 3 weeks ago)

# Overview of the stellar SEDs

## Introduction

This page describes how to set up the grids of stellar spectral energy distributions (SEDs) in versions C07 and later of Cloudy. The ability to read in tables of stellar atmospheres was originally introduced into Cloudy by Kevin Volk around 1990. The current versions use  Peter van Hoof's unified treatment with a single code base and many more stellar SEDs. The StellaratmosphereOld page describes the stellar atmospheres used in Cloudy versions C06.02 and before.

Peter van Hoof wrote this part of Cloudy and is the maintainer. Please post questions, comments, and suggestions for new stellar atmosphere grids on the  Cloudy discussion board.

This page outlines the general method for setting up individual stellar atmosphere grids. Some of the grids are very large and accessing them as ascii files would be slow. They are "compiled" to create direct access binary files. These files, with names ending in "mod", are the files that Cloudy actually uses. These files are hardware dependent, so if you plan to use the code on more than one platform you may need to create separate binary files for each platform. An important exception would be 32-bit and 64-bit versions of the same hardware, for those platforms the binary files are compatible. Most importantly for IA32 and AMD64/EM64T platforms the binary files are compatible.

The following sections describes how to download the original ascii stellar SED files. These files should be placed in the Cloudy data directory.

Each grid of stellar SEDs, along with a link to the paper or web site describing it, is given below. If you use one of these grids in a publication it is very important that you properly cite the original paper describing that grid'' It is intellectually lazy, and deprives the original authors of their proper citation, to simply state that you used an SED that was available in Cloudy.

## Procedure for setting up a stellar SED grid

This describes the general procedure for setting up an individual stellar SED grid. The method is basically the same for all the grids.

1) Cloudy should already have been set up if you got to this page by following the usual steps. I assume you used the recommended directory structure and that the atomic data files are located in a directory data and that Cloudy can be run from any directory.

2) Download the files from the individual web sites listed below. It is OK to skip the grids you don't need (or to skip all of them if you are not going to use stellar atmosphere files at all). Cloudy will work just fine without them as long as you are not explicitly requesting a stellar atmosphere from a missing grid. Some grids are on the original author's web site, while other files are located in the "stars" directory below the main Cloudy  data site. Links are given at the top of each of the sections describing the grids below. Most files have names that end in ascii. An example is ostar2002_p03.ascii (a file from the Tlusty web site). The downloaded grid files should be stored directly in the data directory. Most files have been compressed with gzip. Explode the ascii files using the command "gunzip *.gz". If you downloaded any of the Rauch grids, explode the tarballs with "tar xfz *.tgz".

3) Execute Cloudy with the single command compile stars in the data directory containing the downloaded ascii files. I would do this by first creating a file compile.in containing only this command and then running the code as cloudy.exe -r compile, which directs its output to compile.out.

4) One mod file will be created for each of the downloaded ascii files. An example is ostar2002_p03.mod which is created from the file ostar2002_p03.ascii. You do not need to keep the original ascii files. However, if the internal format of the mod files is changed in a future Cloudy release, or if you decide to change the resolution of the Cloudy frequency grid, you will need to recompile the stellar atmosphere files. Alternatively you can compress the "ascii" files after compilation to save disk space. If you downloaded any of the Rauch grids you will probably want to remove the individual SED files with the command "\rm -f *0.1". There may be a great many of them, and they are still contained in the tarballs you downloaded.

5) You can add grids later (if newer ones become available, or if you change your mind about grids you initially skipped). Download the new files, place them in the data directory and simply go through the same procedure outlined above. Cloudy will skip any grids for which it finds a valid mod file in the data directory (i.e., it will skip any grids that are already compiled).

## Installing Starburst99 grids

The Starburst99 web page is  here. This uses the common code base for stellar atmosphere grids and therefore need to be compiled just like any other grid. The first step is to take the spectrum that was generated by Starburst99 (called xxx.spectrum) and give it a name that ends in .stb99. An example of the Starburst99 format that Cloudy expects is given  here. You can compile the file by giving the single Cloudy command compile stars "<yourname.stb99>". You should replace <yourname.stb99> by the name you chose and make sure it is surrounded by double quotes (as is always the case when you include filenames in Cloudy input). Cloudy will then create two files: yourname.ascii and yourname.mod. The first file is not strictly needed, but you can keep it around in case you want to create mod files for other platforms, or recompile it with a newer version of Cloudy. To use the Starburst99 grid in a simulation, simply include the command table star "<yourname.mod>" <age>.

Use the starburst file by specifying the file name and the log of the age. An example might be table star "starburst.mod" age 6.7 The age will have whatever units are in the original Starburst99 file. The default is years.

The procedure for using Starburst99 grids was changed in c07.02. It was a special command in previous versions.

## Installing PopStar grids

The PopStar models can be obtained  here. Click on "Download Models" on the left-hand side, and then you need to download 1 or more of the zip files in the column "Spectra zip file" on the right-hand side. Models are present for different initial mass functions (IMFs) and metallicities (Z). You can choose to convert a single combination of IMF and Z into a 1-dimensional grid allowing interpolation in age, or combine several runs with the same IMF but different Z values into a 2-dimensional grid allowing interpolation in age as well as log(Z) (note: the latter option is only supported from c10 onwards). The first step is to take an empty (temporary) directory and unzip the files you downloaded in that directory. Next you run the script  convert_popstar.pl (make sure that the file has execute permission) and redirect the output to a file with a name of your choosing ending in .ascii. An example for a single zip file would be:

<download sp-sal1-z0200.zip from PopStar website>
unzip sp-sal1-z0200.zip
chmod +x convert_popstar.pl
convert_popstar.pl > sp-sal1-z0200.ascii


Next you start up the Cloudy executable and type:

compile star "sp-sal1-z0200.ascii"


This will produce a file "sp-sal1-z0200.mod" which you need to move to your Cloudy data directory. After you have done this, you can delete the temporary directory if you wish. Now the grid can be used as described in the next section. The procedure for a 2-dimensional grid is very similar. You need to download and unzip multiple files, but apart from that the procedure is exactly the same. The conversion script will automatically detect that multiple metallicities are present and will alter the resulting .ascii file accordingly. It is not necessary to download all metallicities belonging to a certain IMF, you can also use a subset if you wish. The script will extract the stellar flux only.

The PopStar grids are described in  Molla et al. (2009).

## Installing BPASS grids

The BPASS (Binary Population and Spectral Synthesis) stellar population synthesis models are available  here. We support importing the v2.0 grids that can be downloaded  here under the header "SEDs". The grids are available as tarballs for several different choices of the initial mass function. The tarball contains grids assuming either an instantaneous starburst of 1e6 Msol, or continuous star formation of 1 Msol/yr lasting 1e6 years. Each of these grids has separate models for single-star and binary-star evolution. Grids are available for a range of metallicities ranging from Z=0.001 to 0.040. The first step is to download one or more of the tarballs from the BPASS website. Next you run the script  convert_bpassv2.pl (make sure that the file has execute permission) as is shown below:

<download bpassv2-imf135-100.tar.gz from BPASS website>
chmod +x convert_bpassv2.pl
tar xvfz bpassv2-imf135-100.tar.gz
cd BPASSv2_imf135_100
../convert_bpassv2.pl


Note that the last command has to process lots of data and will take several minutes to complete. It will create four very large ascii files:

BPASSv2_imf135_100_burst_binary.ascii
BPASSv2_imf135_100_burst_single.ascii
BPASSv2_imf135_100_cont_binary.ascii
BPASSv2_imf135_100_cont_single.ascii


Here "burst" refers to the single starburst models and "cont" to the continuous star formation models as outlined above. Furthermore, "single" refers to the single-star evolution models and "binary" to the binary-star evolution models. The ascii files can be converted into binary files in the usual manner by starting Cloudy and typing

compile star "BPASSv2_imf135_100_burst_binary.ascii"


and similar for the other three files. After moving the binary files into the data directory, they can then be used in Cloudy. These are 2D grids allowing interpolation in age and metallicity. You can produce a mix of single and binary stars using e.g.:

table star "BPASSv2_imf135_100_cont_single.mod" 2e8 -1.8
intensity <xxx>
table star "BPASSv2_imf135_100_cont_binary.mod" 2e8 -1.8
intensity <yyy>


The code for calculating the grids is described in  Eldridge & Stanway (2006).

It is possible to install your own atmosphere grids. For this you need to create your own ascii file. Instructions for this are included in the file vanhoof_atmosphere_grids.pdf which is also included as Appendix B of Hazy 1 (starting from c10.00). Once you created the ascii file, compiling it and using it is quite similar to Starburst99 files. To compile, issue the command compile stars "<yourname.ascii>". To use it, issue the command table star "<yourname.mod>" <par1> <par2> ... (the number of parameters here should exactly match the number of parameters you defined in the grid).

## If you don't set up all the stellar SED grids

The Cloudy download includes a large body of test cases that are designed to confirm that the code gets the right answer. Running the test suite is an important part of setting up the code and is described on the TestSuite page.

The test suite includes a number of test cases that are designed to check that the stellar SEDs can be correctly accessed with the table stars command. These tests are in the tsuite/auto directory and have names that start with "stars_". The command ls stars_*.in will list them all. You would need to download all of the stellar grids for all of the star tests to work.

If you decide not to download all of the stellar grids then the stars_* tests that use the missing SEDs will fail. This is not a problem, but is a reminder that some of the table stars commands will not work.

## How to find out which grids you have installed

Two commands will generate information about available grids. You can use these to document which grids are installed after the code has been set up.

The command table star available will list the available grids with parameters. Some of the lines of the output it generates on my system appear as follows:

   ... <snip> ...
table star tlusty Ostar 3-dim <Teff> <log(g)> <log(Z)>
table star werner <Teff> [ <log(g)> ]
table star wmbasic <Teff> <log(g)> <log(Z)>
... <snip> ...


This shows that the Tlusty O star 3-dimensional grid has three parameters, the temperature, gravity, and metallicity. The Werner star grid has two parameters (the square brackets indicate that the second parameter is optional), and the WMbasic grid again has three parameters. This output lists all the grids installed on your computer, excluding any grids that you defined yourself (since Cloudy doesn't know the names you gave to those files).

Starting with Cloudy C17 the output of the table star available command will also list several forms of the table star hm05 and table hm12 commands. These grids differ in certain aspects from the standard stellar atmosphere grids (e.g., they implicitly set the intensity). But they use the same underlying code infrastructure and the data files are fully compatible with standard stellar atmosphere grids. This is why they are included in the output.

The command table star <grid> list will list the models contained in that grid. The parameter <grid> should use the same syntax as given in the output from the table star available command (without the parameters). An example would be table star tlusty Ostar Z+0.3 list, which produces (assuming the grid is installed on your computer):

Teff\lg g|  3.00  3.25  3.50  3.75  4.00  4.25  4.50  4.75
---------|------------------------------------------------
27500 |     1     2     3     4     5     6     7     8
30000 |     9    10    11    12    13    14    15    16
32500 |    --    17    18    19    20    21    22    23
35000 |    --    24    25    26    27    28    29    30
37500 |    --    --    31    32    33    34    35    36
40000 |    --    --    37    38    39    40    41    42
42500 |    --    --    --    43    44    45    46    47
45000 |    --    --    --    48    49    50    51    52
47500 |    --    --    --    53    54    55    56    57
50000 |    --    --    --    --    58    59    60    61
52500 |    --    --    --    --    62    63    64    65
55000 |    --    --    --    --    66    67    68    69


Entries with a number indicate models that are present in the grid. The number is the sequence number in the input file. The command will also work for user-defined grids by supplying the name of the mod file between quotes, e.g. table star "usergrid.mod" list.

## Using the grids

### Standard grids in Cloudy

The table star available command which was explained in the previous section will not only list the available grids on your computer, it will also show the correct syntax to include a stellar atmosphere in your simulation. Parameters between pointed brackets must be replaced by actual numbers. A valid example would be table star tlusty Ostar 3-dim 42300 4.22 -0.73 to get a Tlusty O-star model with Teff = 42,300 K, log g = 4.22, and log Z = -0.73. Parameters between square brackets may be omitted. This is only the case for the log g parameter in 2-dimensional grids. If it is omitted, it will default to the highest log g available in the grid. Hence the commands table star tlusty Ostar Z+0.3 42300 4.75 and table star tlusty Ostar Z+0.3 42300 are both valid and will both produce the exact same model.

### User-defined grids (including Starburst99 and PopStar grids)

For user-defined grids a slightly different syntax is used to include them in a simulation: table star "<yourname.mod>" <par1> <par2> ... The number of parameters supplied must exactly match the number of parameters in the grid. For grids that were generated from Starburst99 output there is only a single parameter: the age. For other grids there may be more, depending on how the grid was defined by the user.

## Using ascii files directly

We are in the process of removing the need for compiled binary files and allow the code work directly on the ascii files. This work is still in progress, but some of the new functionality is already available. Starting with Cloudy version C17 you can use the command table star "<yourname.ascii>" <par1> <par2> ... to interpolate directly on the data in the ascii file and skip the compilation stage. This works well for small grids (roughly 1 to 10 MB in size, depending on the speed of the computer). For large grids we will likely introduce a new (and optional) form of compilation that is independent of the frequency mesh in Cloudy to help speed up the reading process.

Starting with Cloudy C17 we also support the command table star "<yourname.ascii>" list to list the contents of an ascii file. All other table star commands still require the use of compiled binary files.

# Details about individual stellar grids

The following subsections describe details of each of the standard grids now in the code. People who wish to install all the available grids should download all the ascii files in our  stars directory as well as visit the links shown below in the Tlusty, Rauch, and CoStar sections.

## Atlas grids

These are the Castelli & Kurucz ( Castelli, F., Kurucz R. L. 2004, astro-ph/0405087) LTE, plane-parallel, hydrostatic model atmospheres using the newest opacity distribution functions. The original versions of the files are from the  Kurucz web site. These grids come in various metallicities, ranging from log Z = +0.5 to -2.5, all with a turbulent velocity of 2 km/s. There is also a single file atlas_3d_odfnew.ascii.gz which contains all metallicities and which enables interpolation in log Z. If you download the latter file, you do not need any of the other odfnew files, unless you want to run the entire test suite. The ODFNEW models are the most up-to-date and preferred versions of the Atlas models.

These are the final versions of the original Kurucz (Kurucz, R.L. 1991, in "Proceedings of the Conference on Precision Photometry: Astrophysics of the Galaxy", Eds. A.G.D. Philip, A.R. Upgren and K.A. Janes. Schenectady, NY: Davis Press, p. 27) LTE, plane-parallel, hydrostatic model atmospheres. The original versions of the files are from the  Kurucz web site. These grids come in various metallicities, ranging from log Z = +1.0 to -5.0, all with a turbulent velocity of 2 km/s. There is also a single file atlas_3d.ascii.gz which contains all metallicities and which enables interpolation in log Z. If you download the latter file, you do not need any of the other files, unless you want to run the entire test suite. These models are included for backward compatibility and also because they cover a larger range of metallicities. The ODFNEW models further up are the most up-to-date and preferred versions of the Atlas models.

## Tlusty O and B star grids

The  Tlusty code is maintained by Ivan Hubeny & Thierry Lanz. They have produced extensive grids of non-LTE, line-blanketed, plane-parallel, hydrostatic O and B star SEDs. The  'SEDs for Cloudy' link on their main web site gives links to the files we use.

There are 11 sets of O star SEDs compiled from the  OSTAR2002 grid with names "ostar2002_*.ascii.gz". They are described in the reference  Lanz, T., & Hubeny, I. 2003, ApJS, 146, 417. These SEDs are used by the stars_ostar2002*.in simulations in the test suite.

At the time of this writing the B star grid is still under construction. There are currently 7 sets of B star SEDs compiled from the  BSTAR2006 grid with names bstar2006_*.ascii.gz. They are described in the reference  Lanz, T., & Hubeny, I. 2007, ApJS, 169, 83. These SEDs are used by the stars_bstar2006*.in simulations in the test suite.

Starting with the C10 release of Cloudy, we have added support for merged OSTAR2002/BSTAR2006 grids. The resulting grids have a temperature coverage from 15 to 55 kK. In the overlap region between 27.5 and 30 kK, the BSTAR2006 models have been adopted. The merged grids have been produced for all metallicities supported by the BSTAR2006 grid. They have names obstar_merged_*.ascii.gz. When you use one of these grids, you should cite both  Lanz, T., & Hubeny, I. 2003, ApJS, 146, 417 and  Lanz, T., & Hubeny, I. 2007, ApJS, 169, 83. These SEDs are used by the stars_obstar_merged*.in simulations in the test suite.

In general you will not need all the files listed on the Tlusty web site (unless you want to run the entire test suite cleanly) and you will have a couple of choices. If you are only interested in solar metallicity stars then one of the ostar2002_p00.ascii.gz, bstar2006_p00.ascii.gz or obstar_merged_p00.ascii.gz files is enough. If you want to interpolate in metallicity you will need one of the ostar2002_3d.ascii.gz, bstar2006_3d.ascii.gz or obstar_merged_3d.ascii.gz files, but none of the other ones. If you want to run models at other metallicities, but not interpolate in metallicity, you can choose from the remaining files.

## WMbasic O and B stars

The WMbasic code is maintained by  Adi Pauldrach who has a home page  here. He computed a small grid of non-LTE, line-blanketed, and wind-blanketed hot stars with metallicities log Z = 0.0 and -0.3. The original grid of models is  here and is described in  Pauldrach et al., 2001. The grid has been rebinned to create the file that is available above. This is a three-dimensional grid so you must specify temperature, log g, and log Z, in that order.

## CoStar O and B stars

These grids of non-LTE, line blanketed model atmospheres including stellar winds have been developed by Daniel Schaerer and are described in  Schaerer, D., & de Koter, A. 1997, A&A, 322, 598. There are two abundance sets, halo and solar. They are available from the  STScI web site. You need the files Sc1_costar_z020_lb.fluxes (solar abundances) and Sc1_costar_z004_lb.fluxes (halo abundances).

## Rauch PN Nuclei

Thomas Rauch has developed several grids of non-LTE, line-blanketed, plane-parallel, hydrostatic model atmospheres for central stars of planetary nebulae (CSPN). Each of those grids will be discussed separately below. The grids are described in  Rauch, T. 2003, A&A, 403, 709.

### The H-Ni grid

This is the main grid of CSPN model atmospheres. It is described  here. The reference for this grid is  Rauch, T. 2003, A&A, 403, 709. It consists of a set of models ranging between Teff = 50 and 190 kK and log g = 5 and 8. There are two grids included in this file, one for solar abundances (log Z = 0.0) and one for halo abundances (log Z = -1.0). The models treat line blanketing for all elements upto calcium as well as iron group elements. Cloudy will create three ascii files out of this data set: one for the solar abundance grid, one for the halo grid, and a 3-dimensional grid that allows interpolation in log Z.

### The H-Ca grid

This is an earlier version of the H-Ni grid that only treats line blanketing by elements upto calcium. It is described  here. The reference for this grid is  Rauch, T. 1997, A&A 320, 237. For most purposes it is superseded by the H-Ni grid shown above. However, it consists of a set of models ranging between Teff = 50 and 1000 kK and log g = 5 and 9 and therefore covers a larger parameter space than the H-Ni grid. There are two grids included in this file, one for solar abundances (log Z = 0.0) and one for halo abundances (log Z = -1.0). Cloudy will create three ascii files out of this data set: one for the solar abundance grid, one for the halo grid, and a 3-dimensional grid that allows interpolation in log Z.

### The PG1159 grid (aka He+C+N+O)

This is a grid specifically designed for hydrogen-deficient central stars of PNe. It treats an atmosphere consisting only of He and CNO. It is described  here. The reference for this grid is  Rauch, T. 2003, A&A, 403, 709. It consists of a set of models ranging between Teff = 40 and 190 kK and log g = 5 and 9.

### The C/O white dwarf grid (aka C+O+Ne+Mg)

This is a small grid specifically designed for helium-deficient central stars. It treats an atmosphere consisting only of C, O, Ne, and Mg. It is described  here. The model atmospheres have been downloaded using  TheoSSA and have been converted to the Cloudy format. The resulting file rauch_cowd.ascii.gz provided above should be downloaded for use with Cloudy. A paper describing the grid will be submitted in the near future. The grid contains a set of models ranging between Teff = 170 and 250 kK and log g = 8.

### The pure hydrogen grid

This is a grid of pure hydrogen model atmospheres. It is described  here. It consists of a set of models ranging between Teff = 20 and 1000 kK and log g = 4 and 9. Hence it covers a larger parameter space than any of the other grids.

### The pure helium grid

This is a grid of pure helium model atmospheres. It is described  here. It consists of a set of models ranging between Teff = 50 and 1000 kK and log g = 5 and 9.

### The H+He grid

This is a huge 3-dimensional grid of model atmospheres consisting of hydrogen and helium. The helium fraction (by mass) can be set by the user. It is described  here. It consists of a set of models ranging between Teff = 50 and 190 kK, log g = 5 and 9, and the H/He abundance ratio by mass between 1e9/1 and 1/1e9.

## The Haardt & Madau grids

These grids give the cosmic ultraviolet background radiation as a function of redshift. The necessary data files are included in the Cloudy distribution by default, so no separate download is necessary. They were calculated with the  CUBA code. Three versions are available: from 1996, 2005 and 2012. The first data set gives the background for a single redshift, while the latter two give a grid of SEDs as a function of redshift. Since Cloudy version C17, the 2005 and 2012 data sets are implemented using the stellar atmosphere grid infrastructure. These grids differ in certain aspects from the standard stellar atmosphere grids (e.g., they implicitly set the intensity) which is why they have a separate command syntax: table hm96, table hm05, and table hm12. See Hazy 1 for further details. The first two data sets are described in  Haardt & Madau (1996) ApJ 461, 20. The 2012 grid is described in  Haardt & Madau (2012) ApJ 746, 125.

## Historic and test grids

The remaining grids below are only used for testing purposes (Starburst99) or have been obsoleted by newer grids (Kurucz79, Mihalas, Werner). They are only needed for backward compatibility or if you want to run the entire test suite. Please do not use the grids below for any new scientific research.

### Starburst99

The original file was created with the Starburst99 code, as described  here. This file is used by the Cloudy test suite to assure that access to the Starburst99 files still works correctly. It serves no other purpose.

The starburst99_2d.ascii file was produced by Christophe Morisset by manually joining several Starburst99 runs with different metallicities into a single 2D grid. This enables interpolation in both age and metallicity. This file is used to test that this works correctly. It serves no other purpose.

### Kurucz79 O stars

This is a subset of the Kurucz ( Kurucz, R. L. 1979, ApJS, 40, 1) grid of stellar SEDs. They have solar metallicity, log g = 4.0 or 4.5, and temperatures betweeen 30,000 K and 50,000 K. This grid has been obsoleted by the Atlas ODFNEW grids listed above and is only maintained for backward compatibility.

### Mihalas NLTE hot stars

This is a subset of the Mihalas (Mihalas, D. 1972, Non-LTE Model Atmospheres for B & O Stars, NCAR-TN/STR-76) non-LTE O and B star SEDs. They have log g = 4.0. The temperature range is from 30,000 K to 55,000 K. This grid has been obsoleted by the Tlusty, WMbasic, and CoStar non-LTE grids listed above and is only maintained for backward compatibility.

### Werner PN Nuclei

This is the Werner & Heber [Werner, K., & Heber, U. 1991, in Stellar Atmospheres: Beyond Classical Models, p 341, NATO ASI Series C, eds. L. Crivellari, I. Hubney, & D. G. Hummer, (Dordrect: Kluwer)] grid of non-LTE planetary nebula nuclei model atmospheres. This grid has been obsoleted by the Rauch non-LTE grids listed above and is only maintained for backward compatibility.

Running the TestSuite is the next step