The SKIRT project
advanced radiative transfer for astrophysics
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends | List of all members
ToddlersSEDFamily Class Reference

#include <ToddlersSEDFamily.hpp>

Inheritance diagram for ToddlersSEDFamily:
Inheritance graph
[legend]

Public Types

enum class  Resolution : int { Low , High }
 
enum class  SedMode : int { SFRNormalized , Cloud }
 
enum class  SFRPeriod : int { Period10Myr , Period30Myr }
 
enum class  StellarTemplate : int { SB99Kroupa100Sin , BPASSChab100Bin , BPASSChab300Bin }
 

Public Member Functions

 ToddlersSEDFamily (SimulationItem *parent, SedMode sedMode, StellarTemplate stellarTemplate, bool includeDust, Resolution resolution, SFRPeriod sfrPeriod=SFRPeriod::Period10Myr)
 
double cdf (Array &lambdav, Array &pv, Array &Pv, const Range &wavelengthRange, const Array &parameters) const override
 
bool includeDust () const
 
Range intrinsicWavelengthRange () const override
 
vector< SnapshotParameterparameterInfo () const override
 
Resolution resolution () const
 
SedMode sedMode () const
 
SFRPeriod sfrPeriod () const
 
double specificLuminosity (double wavelength, const Array &parameters) const override
 
StellarTemplate stellarTemplate () const
 
virtual double cdf (Array &lambdav, Array &pv, Array &Pv, const Range &wavelengthRange, const Array &parameters) const =0
 
virtual Range intrinsicWavelengthRange () const =0
 
virtual vector< SnapshotParameterparameterInfo () const =0
 
virtual double specificLuminosity (double wavelength, const Array &parameters) const =0
 
- Public Member Functions inherited from SimulationItem
template<class T >
T * find (bool setup=true) const
 
template<class T >
T * interface (int levels=-999999, bool setup=true) const
 
virtual string itemName () const
 
void setup ()
 
string typeAndName () const
 
- Public Member Functions inherited from Item
 Item (const Item &)=delete
 
virtual ~Item ()
 
void addChild (Item *child)
 
const vector< Item * > & children () const
 
virtual void clearItemListProperty (const PropertyDef *property)
 
void destroyChild (Item *child)
 
virtual bool getBoolProperty (const PropertyDef *property) const
 
virtual vector< double > getDoubleListProperty (const PropertyDef *property) const
 
virtual double getDoubleProperty (const PropertyDef *property) const
 
virtual string getEnumProperty (const PropertyDef *property) const
 
virtual int getIntProperty (const PropertyDef *property) const
 
virtual vector< Item * > getItemListProperty (const PropertyDef *property) const
 
virtual ItemgetItemProperty (const PropertyDef *property) const
 
virtual string getStringProperty (const PropertyDef *property) const
 
int getUtilityProperty (string name) const
 
virtual void insertIntoItemListProperty (const PropertyDef *property, int index, Item *item)
 
Itemoperator= (const Item &)=delete
 
Itemparent () const
 
virtual void removeFromItemListProperty (const PropertyDef *property, int index)
 
virtual void setBoolProperty (const PropertyDef *property, bool value)
 
virtual void setDoubleListProperty (const PropertyDef *property, vector< double > value)
 
virtual void setDoubleProperty (const PropertyDef *property, double value)
 
virtual void setEnumProperty (const PropertyDef *property, string value)
 
virtual void setIntProperty (const PropertyDef *property, int value)
 
virtual void setItemProperty (const PropertyDef *property, Item *item)
 
virtual void setStringProperty (const PropertyDef *property, string value)
 
void setUtilityProperty (string name, int value)
 
virtual string type () const
 

Protected Member Functions

 ToddlersSEDFamily ()
 
void setupSelfBefore () override
 
- Protected Member Functions inherited from SEDFamily
 SEDFamily ()
 
- Protected Member Functions inherited from SimulationItem
 SimulationItem ()
 
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
 
virtual void setupSelfAfter ()
 
virtual void setupSelfBefore ()
 
- Protected Member Functions inherited from Item
 Item ()
 

Private Types

using BaseType = SEDFamily
 
using ItemType = ToddlersSEDFamily
 

Private Attributes

StoredTable< 6 > _cloudTable
 
bool _includeDust
 
Resolution _resolution
 
SedMode _sedMode
 
StoredTable< 4 > _sfrNormalizedTable
 
SFRPeriod _sfrPeriod
 
StellarTemplate _stellarTemplate
 

Friends

class ItemRegistry
 

Detailed Description

An instance of the ToddlersSEDFamily class represents the family of star-forming region templates from the TODDLERS model suite (Time evolution of Observables including Dust Diagnostics and Line Emission from Regions containing young Stars).

The TODDLERS model calculates the spherical evolution of a gas cloud around a young stellar cluster, accounting for stellar feedback processes such as stellar winds, supernovae, radiation pressure, and gravitational forces; see Kapoor et al. 2023 (MNRAS, 526, 3871) and Kapoor et al. 2024 (A&A, 692A, 79). The spectra were generated using the third-party Cloudy code based on the results of the evolution model.

Configuration Options

This class offers several user-configured options as described below.

sedMode determines how the SED is calculated and scaled:

stellarTemplate determines the stellar population model, IMF, and stellar evolution:

includeDust determines dust processing in the SEDs:

resolution determines the spectral resolution of the SEDs:

sfrPeriod sets the time period over which SFR is averaged and integrated (only used in SFRNormalized mode):

Wavelength Coverage

The SEDs in the TODDLERS library are tabulated over a wavelength range from 0.01 to 3000 μm (UV through millimeter) and include stellar, nebular, and dust continuum emission along with numerous emission lines from H II, PDR, and molecular gas phases from Cloudy spectral synthesis calculations. For more details, see the discussion on dust processing and spectral resolution in the previous section. The figure below shows the spectral resolution for a high-resolution model.

Emission Line Artifacts

For the high-resolution Cloud-mode models with includeDust=true, the process of subtracting low-resolution line emission from the total low-resolution spectrum before adding high-resolution line profiles can occasionally produce numerical artifacts. These artifacts appear as sharp drops in flux sometimes up to 5 orders of magnitude below the continuum level. This has been observed particularly around mid-IR lines in the 10-30 μm region. The artifacts primarily affect lower mass clouds ( 105.5 M) and occur at the transition points between the continuum and line profiles. The artifacts are expected to have a negligible impact on the integrated line luminosities in actual galaxy simulations using an ensemble of clouds.

Parameter space

The SEDs in the TODDLERS library are tabulated for combinations of the following parameters.

  1. Evolution time (Cloud mode only): the time since the start of evolution
    • Time-dependent evolution from 0.1 to 30 Myr (90 values)
  2. Metallicity:
    • Starburst99: range from Z=0.001 to Z=0.04 (5 values)
    • BPASS: range from Z=0.001 to Z=0.04 (11 values)
  3. Star formation efficiency (SFE): the fraction of cloud mass converted to stars
    • Starburst99: range from 0.01 to 0.15 (7 values)
    • BPASS: range from 0.01 to 0.1 (5 values)
  4. Cloud number density: the initial density of the star-forming cloud
    • Starburst99: range from 10 to 2560 cm3 (9 values)
    • BPASS: range from 40 to 640 cm3 (5 values)
  5. Cloud mass (Cloud mode only): the mass of the star-forming cloud
    • range from 105 to 106.75 M (8 values)

When using SFRNormalized mode, the parameters must appear in the following order, with the specified default units unless overridden by column header info:

Z(dimensionless)SFE(dimensionless)ncl(cm3)M˙(Myr1)

where Z is the metallicity, SFE is the star formation efficiency, ncl is the cloud number density, and M˙ is the star formation rate.

When using Cloud mode, the parameters must appear in the following order, with the specified default units unless overridden by column header info:

t(Myr)Z(dimensionless)SFE(dimensionless)ncl(cm3)Mcl(M)scaling(dimensionless)

where t is the evolution time since the start of star formation, Z is the metallicity, SFE is the star formation efficiency, ncl is the cloud number density, Mcl is the cloud mass, and scaling is an arbitrary scaling factor (typically 1).

Recollapse

If stellar feedback is insufficient to overcome gravity, the evolution of a star-forming cloud includes a recollapse phase, triggering a subsequent generation of star formation. Consequently, at a given point in time, multiple stellar populations of different ages may be present.

In SFRNormalized mode, a constant star formation history is assumed over the past 10 or 30 Myr period (as determined by the sfrPeriod parameter). The model properly accounts for recollapse: any recollapse contribution is pre-integrated over the time evolution (10 or 30 Myr) and cloud mass spectrum ( 105 to 106.75 M) with a power-law distribution ( dN/dMM1.8).

In Cloud mode, users must apply the appropriate scaling to ensure that the star formation rate follows the input model when recollapse occurs. Assuming SKIRT is used to post-process a galaxy snapshot from a hydrodynamical simulation, this can be achieved with the following steps:

  1. Divide the young stellar population particles into temporal bins based on their age.
  2. Calculate recollapse contributions for each temporal bin.
  3. Apply a uniform scaling factor to all particles within a time bin based on the total recollapse contribution in that bin, thereby maintaining the simulated galaxy's total star formation rate.

A Python implementation of this algorithm can be found at https://github.com/anandutsavkapoor/reSample

In other words, when a recollapse event occurs, stellar mass is effectively added to one part of the galaxy while being removed from other parts based solely on the time bin in which the recollapse occurs, without any consideration of spatial proximity or physical connection between these regions. Although this approach preserves the galaxy's total star formation rate, users should consider this limitation when interpreting results, particularly for analyses that are sensitive to local star formation or that examine spatially resolved properties of simulated galaxies. The SFRNormalized mode circumvents this issue at the expense of explicit time evolution.

Resource packs

The tabulated data used by the various TODDLERS models is contained in SKIRT resource packs that need to be downloaded separately. Because of the large size of the Cloud-mode tables, the data are distributed over multiple resource packs. It is recommended to download and install only the packs for the required models:

Member Enumeration Documentation

◆ Resolution

enum class ToddlersSEDFamily::Resolution : int
strong

The enumeration type indicating the wavelength resolution

Low : "Low wavelength resolution (continuum and lines at R=300)" .

High : "High wavelength resolution (continuum at R=300 and lines at R=5e4)" .

◆ SedMode

enum class ToddlersSEDFamily::SedMode : int
strong

The enumeration type indicating the SED calculation mode

SFRNormalized : "SEDs normalized by star formation rate" .

Cloud : "Individual cloud SEDs with time evolution" .

◆ SFRPeriod

enum class ToddlersSEDFamily::SFRPeriod : int
strong

The enumeration type indicating the SFR integration period

Period10Myr : "SFR integrated over 10 Myr" .

Period30Myr : "SFR integrated over 30 Myr" .

◆ StellarTemplate

enum class ToddlersSEDFamily::StellarTemplate : int
strong

The enumeration type indicating the stellar template to use

SB99Kroupa100Sin : "Starburst99 with Kroupa IMF (0.1-100 Msun) and single star evolution" .

BPASSChab100Bin : "BPASS with Chabrier IMF (0.1-100 Msun) and binary star evolution" .

BPASSChab300Bin : "BPASS with Chabrier IMF (0.1-300 Msun) and binary star evolution" .

Constructor & Destructor Documentation

◆ ToddlersSEDFamily() [1/2]

ToddlersSEDFamily::ToddlersSEDFamily ( )
inlineprotected

Default constructor for concrete Item subclass ToddlersSEDFamily : "a TODDLERS SED family for emission from star-forming regions" .

◆ ToddlersSEDFamily() [2/2]

ToddlersSEDFamily::ToddlersSEDFamily ( SimulationItem parent,
SedMode  sedMode,
StellarTemplate  stellarTemplate,
bool  includeDust,
Resolution  resolution,
SFRPeriod  sfrPeriod = SFRPeriod::Period10Myr 
)
explicit

This constructor can be invoked programmatically by classes that use a hard-coded SED family. The newly created object is hooked up as a child to the specified parent in the simulation hierarchy, and its setup() function has been called.

Member Function Documentation

◆ cdf()

double ToddlersSEDFamily::cdf ( Array lambdav,
Array pv,
Array Pv,
const Range wavelengthRange,
const Array parameters 
) const
overridevirtual

This function constructs the normalized probability density function (pdf) and cumulative distribution function (cdf) for the SED with the specified parameters.

Implements SEDFamily.

◆ includeDust()

ToddlersSEDFamily::includeDust ( ) const
inline

This function returns the value of the discoverable Boolean property includeDust : "include dust processing in the SED models" .

The default value for this property is given by the conditional value expression "true" .

◆ intrinsicWavelengthRange()

Range ToddlersSEDFamily::intrinsicWavelengthRange ( ) const
overridevirtual

This function returns the intrinsic wavelength range of the SED family from the stored table.

Implements SEDFamily.

◆ parameterInfo()

vector< SnapshotParameter > ToddlersSEDFamily::parameterInfo ( ) const
overridevirtual

This function returns the number and type of parameters used by this particular SED family as a list of SnapshotParameter objects. Each object specifies unit information and a human-readable description for the parameter.

Implements SEDFamily.

◆ resolution()

ToddlersSEDFamily::resolution ( ) const
inline

This function returns the value of the discoverable Resolution enumeration property resolution : "the wavelength resolution" .

The default value for this property is given by the conditional value expression "Low" .

◆ sedMode()

ToddlersSEDFamily::sedMode ( ) const
inline

This function returns the value of the discoverable SedMode enumeration property sedMode : "SED calculation mode" .

The default value for this property is given by the conditional value expression "SFRNormalized" .

◆ setupSelfBefore()

void ToddlersSEDFamily::setupSelfBefore ( )
overrideprotectedvirtual

This function opens the appropriate resource file (in SKIRT stored table format).

Reimplemented from SimulationItem.

◆ sfrPeriod()

ToddlersSEDFamily::sfrPeriod ( ) const
inline

This function returns the value of the discoverable SFRPeriod enumeration property sfrPeriod : "the SFR integration time period" .

The default value for this property is given by the conditional value expression "Period10Myr" .

This property is relevant only if the Boolean expression "sedModeSFRNormalized" evaluates to true after replacing the names by true or false depending on their presence.

◆ specificLuminosity()

double ToddlersSEDFamily::specificLuminosity ( double  wavelength,
const Array parameters 
) const
overridevirtual

This function returns the specific luminosity Lλ (radiative power per unit of wavelength) for the SED with the specified parameters at the specified wavelength.

Implements SEDFamily.

◆ stellarTemplate()

ToddlersSEDFamily::stellarTemplate ( ) const
inline

This function returns the value of the discoverable StellarTemplate enumeration property stellarTemplate : "the stellar template, IMF, and evolution model to use" .

The default value for this property is given by the conditional value expression "SB99Kroupa100Sin" .


The documentation for this class was generated from the following file: