Wavelength interval of the mean_model SED
Closed this issue · 2 comments
steveschulze commented
Hi,
When I fit photometry and spectroscopy, mean_model
returns a wavelength vector that only covers the interval of the observed spectrum. Is there a user option to specify the output wavelength range?
Cheers,
Steve
fdeugenio commented
Hi Steve,
I had a similar need. If it helps, this is how I did it. There are a few unit changes b/c I prefer mJy
obs2 = copy.deepcopy(obs)
if ('spectrum' in obs.keys()) and (add_model):
obs2['wavelength'] = np.logspace(np.log10(4000.), np.log10(3e7), 15000)
obs2['mask'] = np.ones_like(obs2['wavelength'], dtype=bool)
obs2['unc'] = np.ones_like(obs2['wavelength'])
obs2['spectrum'] = np.ones_like(obs2['wavelength'])
do_not_overplot_mask = (
(obs2['wavelength']>obs['wavelength'][0])
& (obs2['wavelength']<obs['wavelength'][-1]))
pbest = results['bestfit']['parameter']
_, phot2, _ = mod.predict(pbest, obs2, sps=sps)
if ('spectrum' in obs.keys()) and (add_model):
model_sed = mod._sed
model_sed[do_not_overplot_mask] = np.nan
ax0.step(obs2['wavelength']/1e4, model_sed*3631e3, color='darkgoldenrod',
ls='--', lw=1.5, alpha=0.5, where='mid',
label='$\mathrm{Delayed}$-$\\tau \; \mathrm{model\;SED}$')
bd-j commented
I hope this was resolved by the suggestion from @fdeugenio (thanks!). If not, please reopen.