Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions SKIRT/core/BpassSED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@ const SEDFamily* BpassSED::getFamilyAndParameters(Array& parameters)
// set the parameters using arbitrary scaling
NR::assign(parameters, 1., _metallicity, _age);

// construct the library of SED models
return new BpassSEDFamily(this, BpassSEDFamily::IMF::Chabrier300, BpassSEDFamily::Resolution::Original);
// construct the appropriate library of SED models
auto imf = BpassSEDFamily::IMF::Chabrier100;
switch (_imf)
{
case IMF::Chabrier100: imf = BpassSEDFamily::IMF::Chabrier100; break;
case IMF::Chabrier300: imf = BpassSEDFamily::IMF::Chabrier300; break;
case IMF::Kroupa100: imf = BpassSEDFamily::IMF::Kroupa100; break;
case IMF::Kroupa300: imf = BpassSEDFamily::IMF::Kroupa300; break;
}
auto resolution = _resolution == Resolution::Downsampled ? BpassSEDFamily::Resolution::Downsampled
: BpassSEDFamily::Resolution::Original;

return new BpassSEDFamily(this, imf, resolution);
}

////////////////////////////////////////////////////////////////////
22 changes: 21 additions & 1 deletion SKIRT/core/BpassSED.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,32 @@

/** BpassSED is a class that represents spectral energy distributions of simple stellar populations
(SSPs), parameterized on metallicity and age according to the BPASS model that includes binary
stellar systems and that assumes a Chabrier IMF with an upper mass limit of 300 solar masses.
stellar systems and that assumes a Chabrier or Kroupa IMF with upper mass limits of 100 or 300 solar masses.
See the BpassSEDFamily class for more information. */
class BpassSED : public FamilySED
{
/** The enumeration type indicating the IMF to use */
ENUM_DEF(IMF, Chabrier100, Chabrier300, Kroupa100, Kroupa300)
ENUM_VAL(IMF, Chabrier100, "Chabrier IMF (0.1-100 Msun)")
ENUM_VAL(IMF, Chabrier300, "Chabrier IMF (0.1-300 Msun)")
ENUM_VAL(IMF, Kroupa100, "Kroupa IMF (0.1-100 Msun)")
ENUM_VAL(IMF, Kroupa300, "Kroupa IMF (0.1-300 Msun)")
ENUM_END()

/** The enumeration type indicating the wavelength resolution and spectral range */
ENUM_DEF(Resolution, Original, Downsampled)
ENUM_VAL(Resolution, Original, "Original wavelength resolution and range")
ENUM_VAL(Resolution, Downsampled, "Downsampled wavelength resolution and extended wavelength range")
ENUM_END()

ITEM_CONCRETE(BpassSED, FamilySED, "a BPASS single stellar population SED")

PROPERTY_ENUM(imf, IMF, "the assumed initial mass function")
ATTRIBUTE_DEFAULT_VALUE(imf, "Chabrier300")

PROPERTY_ENUM(resolution, Resolution, "the wavelength resolution")
ATTRIBUTE_DEFAULT_VALUE(resolution, "Original")

PROPERTY_DOUBLE(metallicity, "the metallicity of the SSP")
ATTRIBUTE_MIN_VALUE(metallicity, "[1e-5")
ATTRIBUTE_MAX_VALUE(metallicity, "0.04]")
Expand Down
2 changes: 2 additions & 0 deletions SKIRT/core/BpassSEDFamily.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ void BpassSEDFamily::setupSelfBefore()
{
case IMF::Chabrier100: name += "_Chabrier100"; break;
case IMF::Chabrier300: name += "_Chabrier300"; break;
case IMF::Kroupa100: name += "_Kroupa100"; break;
case IMF::Kroupa300: name += "_Kroupa300"; break;
}
if (_resolution == Resolution::Downsampled) name += "_downsampled";

Expand Down
9 changes: 7 additions & 2 deletions SKIRT/core/BpassSEDFamily.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
/** An instance of the BpassSEDFamily class represents a BPASS family of single stellar population
(SSP) %SED templates (Eldridge, Stanway et al, 2017, PASA 34, 58; Stanway and Eldridge, 2018,
MNRAS, 479, 75). We use the BPASS data release version 2.2.1 (July 2018) of the model that
includes binary stellar systems and that assumes a Chabrier IMF.
includes binary stellar systems and that assumes Chabrier and Kroupa IMFs.


The SED templates are parametrized on metallicity (1e-5 - 0.04) and age (1 Myr - 100 Gyr), and
scale with the initial mass of the SSP.
Expand All @@ -24,6 +25,8 @@
\em imf determines the IMF, more specifically the upper limit of the stellar mass range:
- Chabrier100: Chabrier IMF with stellar masses from 0.1 to 100 \f$\mathrm{M}_\odot\f$
- Chabrier300: Chabrier IMF with stellar masses from 0.1 to 300 \f$\mathrm{M}_\odot\f$
- Kroupa100: Kroupa IMF with stellar masses from 0.1 to 100 \f$\mathrm{M}_\odot\f$
- Kroupa300: Kroupa IMF with stellar masses from 0.1 to 100 \f$\mathrm{M}_\odot\f$

\em resolution determines the spectral resolution and the wavelength coverage:
- Original: the wavelength grid has a resolution of 1 Angstrom over the wavelength range
Expand Down Expand Up @@ -51,9 +54,11 @@
class BpassSEDFamily : public SEDFamily
{
/** The enumeration type indicating the IMF to use */
ENUM_DEF(IMF, Chabrier100, Chabrier300)
ENUM_DEF(IMF, Chabrier100, Chabrier300, Kroupa100, Kroupa300)
ENUM_VAL(IMF, Chabrier100, "Chabrier IMF (0.1-100 Msun)")
ENUM_VAL(IMF, Chabrier300, "Chabrier IMF (0.1-300 Msun)")
ENUM_VAL(IMF, Kroupa100, "Kroupa IMF (0.1-100 Msun)")
ENUM_VAL(IMF, Kroupa300, "Kroupa IMF (0.1-300 Msun)")
ENUM_END()

/** The enumeration type indicating the wavelength resolution and spectral range */
Expand Down
2 changes: 1 addition & 1 deletion SKIRT/resources/ExpectedResources.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Core 8
BPASS 2
BPASS 3
TODDLERS 2
TODDLERS_Cloud_BPASS_chab100 2
TODDLERS_Cloud_BPASS_chab300 2
Expand Down