resample_template

msaexp.resample.resample_template(spec_wobs, spec_R_fwhm, templ_wobs, templ_flux, velocity_sigma=100, nsig=5, fill_value=0.0, wave_min=0.0, wave_max=1000000.0, left=0.0, right=0.0)[source]

Resample a high resolution template/model on the wavelength grid of a spectrum with (potentially) wavelength dependent dispersion

Parameters
spec_wobsarray-like

Spectrum wavelengths

spec_R_fwhmarray-like

Spectral resolution wave/d(wave), FWHM

templ_wobsarray-like

Template wavelengths, observed frame. Same units as spec_wobs. NB: both spec_wobs and templ_wobs assumed to be sorted!

templ_fluxarray-like

Template flux densities sampled at templ_wobs

velocity_sigmafloat

Kinematic velocity width, km/s

nsigfloat

Number of sigmas of the Gaussian convolution kernel to sample

wave_minfloat

Minimum wavelength to consider

wave_maxfloat

Maximum wavelength to consider

left, rightfloat

Fill values when wavelengths less (greater) than wave_min (wave_max)

Returns
resamparray-like

Template resampled at the spec_wobs wavelengths, convolved with a Gaussian kernel with sigma width

>>> Rw = 1./np.sqrt((velocity_sigma/3.e5)**2 + 1./(spec_R_fwhm*2.35)**2)
>>> dw = spec_wobs / Rw