diff --git a/SKIRT/core/BpassSED.cpp b/SKIRT/core/BpassSED.cpp index a60f0014..a5af1098 100644 --- a/SKIRT/core/BpassSED.cpp +++ b/SKIRT/core/BpassSED.cpp @@ -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); } //////////////////////////////////////////////////////////////////// diff --git a/SKIRT/core/BpassSED.hpp b/SKIRT/core/BpassSED.hpp index 66b1cbe6..04af04ea 100644 --- a/SKIRT/core/BpassSED.hpp +++ b/SKIRT/core/BpassSED.hpp @@ -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]") diff --git a/SKIRT/core/BpassSEDFamily.cpp b/SKIRT/core/BpassSEDFamily.cpp index f571416d..e967bca8 100644 --- a/SKIRT/core/BpassSEDFamily.cpp +++ b/SKIRT/core/BpassSEDFamily.cpp @@ -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"; diff --git a/SKIRT/core/BpassSEDFamily.hpp b/SKIRT/core/BpassSEDFamily.hpp index 92c21c13..2cd34490 100644 --- a/SKIRT/core/BpassSEDFamily.hpp +++ b/SKIRT/core/BpassSEDFamily.hpp @@ -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. @@ -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 @@ -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 */ diff --git a/SKIRT/resources/ExpectedResources.txt b/SKIRT/resources/ExpectedResources.txt index 848a0049..9bae958d 100644 --- a/SKIRT/resources/ExpectedResources.txt +++ b/SKIRT/resources/ExpectedResources.txt @@ -1,5 +1,5 @@ Core 8 -BPASS 2 +BPASS 3 TODDLERS 2 TODDLERS_Cloud_BPASS_chab100 2 TODDLERS_Cloud_BPASS_chab300 2