ExtendedFsps¶
- class eazy.sps.ExtendedFsps[source]¶
Bases:
object
Extended functionality for the
fsps.StellarPopulation
objectAttributes Summary
(linear) ages of the FSPS SSP age grid, Gyr
Get zmet index for nearest
self.zlegend
value tologgzsol
.Full metadata, including line properties
dict
version ofself.params
SFR averaged over last MAXIMUM(tage, 10 Myr) from
sfr_avg
SFR averaged over maximum(tage, 100 Myr) from
sfr_avg
Methods Summary
as_template
(wave, flux[, label, meta])Return a
eazy.templates.Template
object with metadatacontinuum_to_obsframe
([zred, cosmology, ...])Compute a normalization factor to scale input FSPS model flux density units of (L_sun / Hz) or (L_sun / AA) to observed-frame
unit
.fit_grism
(mb[, plist, func_kwargs, verbose, ...])Fit models to grism spectrum
fit_phot
(phot_dict[, filters, flux_unit, ...])Fit models to observed spectrum
fit_spec
(wave_obs, flux_obs, err_obs[, ...])Fit models to observed spectrum
get_full_spectrum
([tage, Av, get_template, ...])Get full spectrum with reprocessed emission lines and dust emission
light_age_band
([bands, flat])Get light-weighted age of current model
line_to_obsframe
([zred, cosmology, verbose, ...])Scale factor to convert internal line luminosities (L_sun) to observed frame
lognorm_avg_sfr
([tage, dt])Analytic average SFR for lognorm SFH
lognormal_integral
([tage])Integral of lognormal SFH up to t=tage
narrow_emission_lines
([tage, emwave, ...])Replace broad FSPS lines with specified line widths
objfun_fitgrism
(theta, self, plist, mb, TEF, ...)Objective function for fitting spectra
objfun_fitphot
(theta, self, plist, flux_fnu, ...)Objective function for fitting spectra
objfun_fitspec
(theta, self, plist, wave_obs, ...)Objective function for fitting spectra
param_floats
([params])Return a list of parameter values.
parameter_bounds
(params[, limit_age])Parameter bounds for
scipy.optimize.least_squares
pset
(params)Return a subset dictionary of
self.meta
redden
(wave)set_dust
([Av, dust_obj_type, wg00_kwargs])Set
dust_obj
attributeset_fir_template
([arrays, file, verbose, ...])Set the far-IR template for reprocessed dust emission
set_lognormal_sfh
([min_sigma, verbose])Set lognormal tabular SFH
Attributes Documentation
- FFT_SMOOTH = False¶
- cosmology = FlatLambdaCDM(name='WMAP9', H0=<Quantity 69.32 km / (Mpc s)>, Om0=0.2865, Tcmb0=<Quantity 2.725 K>, Neff=3.04, m_nu=<Quantity [0., 0., 0.] eV>, Ob0=0.04628)¶
- fsps_ages¶
(linear) ages of the FSPS SSP age grid, Gyr
- is_lognorm_sfh = False¶
- izmet¶
Get zmet index for nearest
self.zlegend
value tologgzsol
.
- line_av_func = None¶
- lognorm_center = 0.0¶
- lognorm_fburst = -30¶
- lognorm_logwidth = 0.05¶
- lsf_func = None¶
- meta¶
Full metadata, including line properties
- scale_lines = {}¶
- scale_lyman_series = 0.1¶
- sfr10¶
SFR averaged over last MAXIMUM(tage, 10 Myr) from
sfr_avg
- sfr100¶
SFR averaged over maximum(tage, 100 Myr) from
sfr_avg
Methods Documentation
- as_template(wave, flux, label='fsps_tau{tau:3.1f}_logz{logzsol:4.2f}_tage{tage:4.2f}_av{Av:4.2f}', meta=None)[source]¶
Return a
eazy.templates.Template
object with metadata
- continuum_to_obsframe(zred=None, cosmology=None, unit=Unit('uJy'), verbose=False, target_stellar_mass=None, target_sfr=None, target_lir=None)[source]¶
Compute a normalization factor to scale input FSPS model flux density units of (L_sun / Hz) or (L_sun / AA) to observed-frame
unit
.If
target_stellar_mass
,target_sfr
, ortarget_lir
specified, then scale the output to the desired value using the intrinsic properties. Units are linearMsun
,Msun/yr
, andLsun
, respectively.
- fit_grism(mb, plist=['tage', 'zred'], func_kwargs={'lorentz': False}, verbose=True, lsq_kwargs={'loss': 'huber', 'max_nfev': 200, 'method': 'trf', 'verbose': True, 'x_scale': 1.0}, show=False, TEF=None, photoz_obj=None, flux_unit=Unit('erg / (Angstrom s cm2)'))[source]¶
Fit models to grism spectrum
- fit_phot(phot_dict, filters=None, flux_unit=Unit('uJy'), plist=['tage', 'Av', 'gas_logu', 'sigma_smooth'], func_kwargs={'lorentz': False}, verbose=True, lsq_kwargs={'loss': 'huber', 'max_nfev': 200, 'method': 'trf', 'verbose': True, 'x_scale': 1.0}, show=False, TEF=None, photoz_obj=None)[source]¶
Fit models to observed spectrum
- fit_spec(wave_obs, flux_obs, err_obs, mask=None, plist=['tage', 'Av', 'gas_logu', 'sigma_smooth'], func_kwargs={'lorentz': False}, verbose=True, bspl_kwargs=None, cheb_kwargs=None, lsq_kwargs={'loss': 'huber', 'max_nfev': 200, 'method': 'trf', 'verbose': True, 'x_scale': 1.0}, show=False)[source]¶
Fit models to observed spectrum
- get_full_spectrum(tage=1.0, Av=0.0, get_template=True, set_all_templates=False, z=None, tie_metallicity=True, **kwargs)[source]¶
Get full spectrum with reprocessed emission lines and dust emission
dust_fraction: Fraction of the SED that sees the specified Av
- line_to_obsframe(zred=None, cosmology=None, verbose=False, unit=<Quantity 1.e-17 erg / (s cm2)>, target_stellar_mass=None, target_sfr=None, target_lir=None)[source]¶
Scale factor to convert internal line luminosities (L_sun) to observed frame
If
target_stellar_mass
,target_sfr
, ortarget_lir
specified, then scale the output to the desired value using the intrinsic properties. Units are linearMsun
,Msun/yr
, andLsun
, respectively.
- narrow_emission_lines(tage=0.1, emwave=[], line_sigma=100, oversample=5, clip_sigma=10, verbose=False, get_eqw=True, scale_lyman_series=None, scale_lines={}, force_recompute=False, use_sigma_smooth=True, lorentz=False, **kwargs)[source]¶
Replace broad FSPS lines with specified line widths
tage : age in Gyr of FSPS model FSPS sigma: line width in A in FSPS models emwave : (approx) wavelength of line to replace line_sigma : line width in km/s of new line oversample : factor by which to sample the Gaussian profiles clip_sigma : sigmas from line center to use for the line scale_lyman_series : scaling to apply to Lyman-series emission lines scale_lines : scaling to apply to other emission lines, by name
- Returns:
dict
with keys wave_full, flux_full, line_full = wave and flux with fine lines wave, flux_line, flux_clean = original model + removed lines ymin, ymax = range of new line useful for plotting
- Returns:
- static objfun_fitgrism(theta, self, plist, mb, TEF, kwargs, ret_type)[source]¶
Objective function for fitting spectra
- static objfun_fitphot(theta, self, plist, flux_fnu, err_fnu, is_flam, filters, TEF, kwargs, ret_type)[source]¶
Objective function for fitting spectra
- static objfun_fitspec(theta, self, plist, wave_obs, flux_obs, err_obs, mask, bspl, kwargs, ret_type)[source]¶
Objective function for fitting spectra
- param_floats(params=None)[source]¶
Return a list of parameter values. If
params
is None, then use full list inself.params.all_params
.
- parameter_bounds(params, limit_age=False)[source]¶
Parameter bounds for
scipy.optimize.least_squares
- set_dust(Av=0.0, dust_obj_type='WG00x', wg00_kwargs={'dust_distribution': 'homogeneous', 'dust_type': 'mw', 'geometry': 'shell'})[source]¶
Set
dust_obj
attributedust_obj_type:
‘WG00’ =
dust_attenuation.radiative_transfer.WG00
‘C00’ =dust_attenuation.averages.C00
‘WG00x’ =ParameterizedWG00
‘KC13’ = Kriek & Conroy (2013) with dust_index parameter ‘R15’ = Reddy et al. (2015) with dust bump parameter- ir_template: (wave, flux)
Template to use for re-emitted IR light