# Parameter Specification¶

## Automated Parameter File Generation¶

The remainder of this section contains information on how parameter files are formatted, and exactly how parameter choices specify code behavior. However, as a convenience SLUG comes with a python script that provides a simple menu-driven interface to write parameter files automatically. The script can be started by doing:

python tools/write_param.py

Once started, the script provides a series of menus that allow the user to set all the keywords specified below. The script can then write a validly-formatted parameter file based on the options chosen.

## File Format¶

An example parameter file is included as param/example.param in the source tree. Parameter files for SLUG are generically formatted as a series of entries of the form:

keyword    value

Any line starting with # is considered to be a comment and is ignored, and anything on a line after a # is similarly treated as a comment and ignored. Some general rules on keywords are:

• Keywords may appear in any order.
• Some keywords have default values, indicated in parenthesis in the list below. These keywords are optional and need not appear in the parameter file. All others are required.
• Keywords and values are case-insensitive.
• Unless explicitly stated otherwise, units for mass are always $$M_\odot$$, units for time are always yr.
• Any time a file or directory is specified, if it is given as a relative rather than absolute path, it is assumed to be relative to the environment variable \$SLUG_DIR. If this environment variable is not set, it is assumed to be relative to the current working directory. EXCEPTION: the output directory (if it is specified as a relative rather than absolute path) is always assumed to be relative to the current working directory.

The keywords recognized by SLUG can be categorized as described in the remainder of this section.

## Basic Keywords¶

These specify basic data for the run.

• model_name (default: SLUG_DEF): name of the model. This will become the base filename for the output files.
• out_dir (default: current working direcory): name of the directory into which output should be written. If not specified, output is written into the directory from which the SLUG executable is called.
• verbosity (default: 1): level of verbosity when running, with 0 indicating no output, 1 indicating some output, and 2 indicating a great deal of output.

## Simulation Control Keywords¶

These control the operation of the simulation.

• sim_type (default: galaxy): set to galaxy to run a galaxy simulation (a composite stellar population), or to cluster to run a cluster simulation (a simple stellar population)
• n_trials (default: 1): number of trials to run
• log_time (default: 0): set to 1 for logarithmic time step, 0 for linear time steps
• time_step: size of the time step. If log_time is set to 0, this is in yr. If log_time is set to 1, this is in dex (i.e., a value of 0.2 indicates that every 5 time steps correspond to a factor of 10 increase in time). Alternately, if time_step is set to any value that cannot be converted to a real number, then this is interpreted as giving the name of a PDF file, which must be formatted as described in Probability Distribution Functions. In this case one output time will be selected randomly for each trial from the specified PDF. This option is useful, for example, for generating a library of simulations that are randomly sampled in stellar population age. For the PDF option, the options log_time, start_time and end_time will all be ignored, as the relevant parameters will be taken from the specified PDF file. This keyword may be omitted, and will be ignored, if output_times is set.
• start_time: first output time. This may be omitted if log_time is set to 0, in which case it defaults to a value equal to time_step. It may also be omitted if output_times is set.
• end_time: last output time, in yr. This may be omitted of output_times is set. Note that not all the tracks include entries going out to times >1 Gyr, and the results will become inaccurate if the final time is larger than the tracks allow.
• output_times: an optional parameter giving an exact list of times in yr at which to write output. This must be specified as a comma-separated list, i.e., time0, time1, time2, ..., where all times are positive and are in strictly increasing order. There is no limit on the number of output times that may be included. This parameter may be omitted if end_time and time_step are set. If this parameter is set, it overrides start_time, end_time, and time_step.
• sfr: star formation rate. Only used if sim_type is galaxy; for cluster, it will be ignored, and can be omitted. This parameter can be set in three ways. If the value given is a number, it will be interpreted as specifying a constant star formation rate. If it is the string sfh, the code will interpret this as a flag that a star formation history should be read from the file specified by the sfh keyword. If the parameter value is any other string that cannot be converted to a numerical value, it will be interpreted as the name of a PDF file (see Probability Distribution Functions); a (constant) value of the star formation rate for each trial will be drawn from this PDF.
• sfh: name of star formation history file. This file is a PDF file, formatted as described in Probability Distribution Functions. This is ignored, and can be omitted, if sim_type is cluster, or if sfr is not set to sfh.
• cluster_mass: mass of the star cluster for simulations with sim_type set to cluster. This can be omitted, and will be ignored, if sim_type is galaxy. This parameter can be set to either a positive number or to the string cmf. If it is set to a numerical value, that value will be used as the cluster mass, in $$M_\odot$$ for each trial. If it is set to cmf, then a new cluster mass will be drawn from the CMF for each trial.
• redshift (default: 0): place the system at the specified redshift. The computed spectra and photometry will then be computed in the observed rather than the rest frame of the system.

## Output Control Keywords¶

These control what quantities are computed and written to disk. Full a full description of the output files and how they are formatted, see Output Files and Format.

• out_cluster (default: 1): write out the physical properties of star clusters? Set to 1 for yes, 0 for no.
• out_cluster_phot (default: 1): write out the photometry of star clusters? Set to 1 for yes, 0 for no.
• out_cluster_spec (default: 1): write out the spectra of star clusters? Set to 1 for yes, 0 for no.
• out_cluster_yield (default: 1): write out the yield of star clusters? Set to 1 for yes, 0 for no.
• out_integrated (default: 1): write out the integrated physical properties of the whole galaxy? Set to 1 for yes, 0 for no. This keyword is ignored if sim_type is cluster.
• out_integrated_phot (default: 1): write out the integrated photometry of the entire galaxy? Set to 1 for yes, 0 for no. This keyword is ignored if sim_type is cluster.
• out_integrated_spec (default: 1): write out the integrated spectra of the entire galaxy? Set to 1 for yes, 0 for no. This keyword is ignored if sim_type is cluster.
• out_integrated_yield (default: 1): write out the integrated yield of the entire galaxy? Set to 1 for yes, 0 for no. This keyword is ignored if sim_type is cluster.
• output_mode (default: ascii): set to ascii, binary, or fits. Selecting ascii causes the output to be written in ASCII text, which is human-readable, but produces much larger files. Selecting binary causes the output to be written in raw binary. Selecting fits causes the output to be written FITS format. This will be somewhat larger than raw binary output, but the resulting files will be portable between machines, which the raw binary files are not guaranteed to be. All three output modes can be read by the python library, though with varying speed – ASCII output is slowest, FITS is intermediate, and binary is fastest.

## Stellar Model Keywords¶

These specify the physical models to be used for stellar evolution, atmospheres, the IMF, extinction, etc.

• imf (default: lib/imf/chabrier.imf): name of the IMF descriptor file; this is a PDF file, formatted as described in Probability Distribution Functions. Note that SLUG ships with the following IMF files pre-defined (in the directory lib/imf)
• cmf (default: lib/cmf/slug_default.cmf): name of the CMF descriptor file; this is a PDF file, formatted as described in Probability Distribution Functions. The default selection is a power law $$dN/dM \propto M^{-2}$$ from $$M = 10^2 - 10^7\;M_\odot$$. This is ignored, and may be omitted, if sim_type is set to cluster and cluster_mass is set to a numerical value.
• clf (default: lib/clf/slug_default.clf): name of the CLF descriptor file; this is a PDF file, formatted as described in Probability Distribution Functions. The default gives a power law distribution of lifetimes $$t$$ with $$dN/dt\propto t^{-1.9}$$ from 1 Myr to 1 Gyr. Note that this corresponds to a cluster age distribution of slope -0.9. The SLUG source also ships with an alternative CLF file, lib/clf/nodisrupt.clf, which disables cluster disruption entirely (by setting the lifetime distribution to a $$\delta$$ function at $$10^{300}$$ yr).
• tracks (default: lib/tracks/Z0140v00.txt): stellar evolution tracks to use. The following tracks ship with SLUG (all in the directory lib/tracks):
• ZXXXXvYY.txt: Geneva (2013) tracks; metallicities are Solar (XXXX = 0140) and 1/7 Solar (XXXX = 0020), and rotation rates are 0 (YY = 00) and 40% of breakup (YY = 40).
• modcXXX.dat: Geneva tracks with standard mass loss, for metallicities of $$2\times$$ Solar (040), Solar (020), $$0.4\times$$ Solar (008), $$0.2\times$$ Solar (004), and $$0.05\times$$ Solar (001).
• modeXXX.dat: same as modcXXX.dat, but with higher mass loss rates.
• modpXXX.dat: Padova tracks with thermally pulsing AGB stars; metallicities use the same scale as modcXXX.dat files (i.e., 020 is Solar).
• modsXXX.dat: same as modpXXX.dat, but without thermally pulsing AGB stars
• atmospheres (default: lib/atmospheres): directory where the stellar atmosphere library is located. Note that file names are hard-coded, so if you want to use different atmosphere models with a different format, you will have to write new source code to do so.
• yields (default: lib/yields): directory where the stellar yield tables are located. Note that the file name and format is hardcoded, so if you want to use a different format, you will have to write source code to do so.
• specsyn_mode (default: sb99): spectral synthesis mode. Allowed values are:
• planck: treat all stars as black bodies
• Kurucz: use Kurucz atmospheres, as compiled by Lejeune et al. (1997, A&AS, 125, 229), for all stars
• Kurucz+Hillier: use Kurucz atmospheres for all stars except Wolf-Rayet stars; WR stars use Hillier model atmospheres (Hillier & Miller, 1998, ApJ, 496, 407)
• Kurucz+Pauldrach: use Kurucz atmospheres for all stars except OB stars; OB stars use Pauldrach model atmospheres (Pauldrach et al., 2001, A&A, 375, 161)
• SB99: emulate the behavior of starburst99: use Pauldrach for OB stars, Hillier for WR stars, and Kurucz for all other stars
• clust_frac (default: 1.0): fraction of stars formed in clusters
• min_stoch_mass (default: 0.0): minimum stellar mass to be treated stochastically. All stars with masses below this value are assumed to be sampled continuously from the IMF.
• metallicity: metallicity of the stellar population, relative to solar. This may be omitted if tracks is set to one of the default sets of tracks that ships with SLUG, as the metallicities for these tracks are hardwired in. This keyword is provided to allow users to supply their own tracks.
• WR_mass: minimum starting mass that stars must have in order to pass through a Wolf-Rayet phase. This can be omitted if tracks is set to one of the default sets of tracks that ships with SLUG, as the WR cutoff masses for these tracks are hardwired in. This keyword is provided to allow users to supply their own tracks.

## Extinction Keywords¶

• A_V (default: no extinction): extinction distribution. This parameter has three possible behaviors. If the parameter A_V is omitted entirely, then the code will not compute extinction-corrected spectra or photometry at all; only unextincted values will be reported. If this parameter is specified as a real number, it will be interepreted as specifying a uniform extinction value $$A_V$$, in mag, and this extinction will be applied to all predicted light output. Finally, if this parameter is a string that cannot be converted to a real number, it will be interpreted as the name of a PDF file, formatted as described in Probability Distribution Functions, specifying the probability distribution of $$A_V$$ values, in mag.
• extinction_curve (default: lib/extinct/SB_ATT_SLUG.dat) file specifying the extinction curve; the file format is two columns of numbers in ASCII, the first giving the wavelength in Angstrom and the second giving the exintction $$\kappa_\nu$$ at that wavelength / frequency in $$\mathrm{cm}^2$$. Note that the absolute normalization of the exitnction curve is unimportant; only the wavelength-dependence matters (see Spectra and Photometry). SLUG ships with the following extinction curves (all in lib/extinct):
• nebular_extinction_factor (default: 1.0): nebular extinction excess factor. This parameter specifies the ratio of the extinction applied to the nebular light to that applied to the starlight, i.e., it gives $$f_{\mathrm{neb,ex}} = A_{V,\mathrm{neb}} / A_{V,*}$$, as defined in Extinction. As with A_V, this parameter can be set either to a real number, in which case this ratio is treated as constant and equal to the input number, or to the name of a PDF file that specified the distribution of this ratio, formatted as described in Probability Distribution Functions. If this keyword is omitted entirely, the nebular and stellar extinctions are set equal to one another.

## Nebular Keywords¶

• compute_nebular (default: 1): compute the spectrum that results after starlight is processed through the nebula surrounding each cluster or star? Set to 1 for yes, 0 for no.
• atomic_data (default: lib/atomic/): directory where the atomic data used for nebular emission calculations is located
• nebular_no_metals (default: 0): if set to 1, metal lines are not used when computing nebular emission
• nebular_den (default: 1e2): hydrogen number density in $$\mathrm{cm}^{-3}$$ to use in nebular emission computations
• nebular_temp (default: -1): gas kinetic temperature in K to use in nebular emission computations; if set to non-positive value, the temperature will be determined via the lookup table of cloudy runs for fully sampled IMFs
• nebular_logU (default: -3): log of dimensionless volume-weighted ionization parameter to assume when computing metal line emission and HII region temperatures from the tabulated cloudy data. At present the allowed values are -3, -2.5, and -2.
• nebular_phi (default: 0.73): fraction of ionizing photons absorbed by H atoms rather than being absorbed by dust grains or rescaping; the default value of 0.73, taken from McKee & Williams (1997, ApJ, 476, 144) means that 73% of ionizing photons are absorbed by H

## Photometric Filter Keywords¶

These describe the photometry to be computed. Note that none of these keywords have any effect unless out_integrated_phot or out_cluster_phot is set to 1.

• phot_bands: photometric bands for which photometry is to be computed. The values listed here can be comma- or whitespace-separated. For a list of available photometric filters, see the file lib/filters/FILTER_LIST. In addition to these filters, SLUG always allows four special “bands”:
• QH0: the $$\mathrm{H}^0$$ ionizing luminosity, in photons/sec
• QHe0: the $$\mathrm{He}^0$$ ionizing luminosity, in photons/sec
• QHe1: the $$\mathrm{He}^+$$ ionizing luminosity, in photons/sec
• Lbol: the bolometric luminosity, in $$L_\odot$$
• filters (default: lib/filters): directory containing photometric filter data
• phot_mode (default: L_nu): photometric system to be used when writing photometric outputs. Full definitions of the quantities computed for each of the choices listed below are given in Spectra and Photometry. Note that these values are ignored for the four special bands QH0, QHe0, QHe1, and Lbol. These four bands are always written out in the units specified above. Allowed values are:
• L_nu: report frequency-averaged luminosity in the band, in units of erg/s/Hz
• L_lambda: report wavelength-averaged luminosity in the band, in units of erg/s/Angstrom
• AB: report AB magnitude
• STMAG: report ST magnitude
• VEGA: report Vega magnitude