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
12 changes: 11 additions & 1 deletion src/fsps/fsps.f90
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ subroutine interp_ssp(ns,zpos,tpos,spec,mass,lbol)

end subroutine

subroutine smooth_spectrum(ns,wave,spec,sigma_broad,minw,maxw)

subroutine smooth_spectrum(ns,wave,spec,sigma_broad,minw,maxw)

! Smooth the spectrum by a gaussian of width sigma_broad

Expand Down Expand Up @@ -442,6 +443,15 @@ subroutine get_zlegend(n_z,z_legend)

end subroutine

subroutine get_zsol(z_sol)

! Get the definition of solar metallicity.
implicit none
double precision, intent(out) :: z_sol
z_sol = zsol

end subroutine

subroutine get_timefull(n_age,timefull)

! Get the actual time steps of the SSPs.
Expand Down
24 changes: 18 additions & 6 deletions src/fsps/fsps.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class StellarPopulation(object):

:param tau: (default: 1.0)
Defines e-folding time for the SFH, in Gyr. Only used if ``sfh=1`` or
``sfh=4``. The range is :math:`0.1 < \tau < 10^2`.
``sfh=4``.

:param const: (default: 0.0)
Defines the constant component of the SFH. This quantity is defined as
Expand Down Expand Up @@ -363,9 +363,10 @@ class StellarPopulation(object):
component (i.e. that is not affected by ``dust2``).

:param frac_obrun: (default: 0.0)
Fraction of the young stars (age < dust_tesc) that are not attenuated
by ``dust1``, representing runaway OB stars. These stars are still
attenuated by ``dust2``.
Fraction of the young stars (age < dust_tesc) that are not attenuated by
``dust1`` and that do not contribute to any nebular emission,
representing runaway OB stars or escaping ionizing radiation. These
stars are still attenuated by ``dust2``.

:param dust_index: (default: -0.7)
Power law index of the attenuation curve. Only used when
Expand Down Expand Up @@ -537,6 +538,7 @@ def __init__(
self._wavelengths = None
self._emwavelengths = None
self._zlegend = None
self._solar_metallicity = None
self._ssp_ages = None
self._stats = None
self._libraries = None
Expand Down Expand Up @@ -837,7 +839,7 @@ def isochrones(self, outfile="pyfsps_tmp"):
Write the isochrone data (age, mass, weights, phases, magnitudes, etc.)
to a .cmd file, then read it into a huge numpy array. Only parameters
listed in ``StellarPopulation.params.ssp_params`` affect the output of
this method.
this method. This method does not work for the BPASS isochrones.

:param outfile: (default: 'pyfsps_tmp')
The file root name of the .cmd file, which will be placed in the
Expand All @@ -859,6 +861,9 @@ def isochrones(self, outfile="pyfsps_tmp"):
* log(weight): IMF weight corresponding to a total of 1 Msol formed.
* log(mdot): mass loss rate (Msol/yr)
"""
if self.isoc_library.decode("utf-8") == "bpss":
raise ValueError("CMDs cannot be generated for the BPASS isochrones.")

if self.params.dirty:
self._compute_csp()

Expand Down Expand Up @@ -1044,6 +1049,14 @@ def zlegend(self):
self._zlegend = driver.get_zlegend(NZ)
return self._zlegend

@property
def solar_metallicity(self):
r"""The definition of solar metallicity, as a mass fraction.
E.g. Z_sol \sim 0.014-0.02"""
if self._solar_metallicity is None:
self._solar_metallicity = driver.get_zsol()
return self._solar_metallicity

@property
def ssp_ages(self):
r"""The age grid of the SSPs, in log(years), used by FSPS."""
Expand Down Expand Up @@ -1184,7 +1197,6 @@ def duste_library(self):
r"""The name of the dust emission SED library being used in FSPS."""
return self.libraries[2]


@property
def libraries(self):
if self._libraries is None:
Expand Down