resample_template_numba¶
- msaexp.resample_numba.resample_template_numba(spec_wobs, spec_R_fwhm, templ_wobs, templ_flux, templ_unc=None, spec_dwobs=None, 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: bothspec_wobsandtempl_wobsassumed to be sorted!- templ_fluxarray-like
Template flux densities sampled at
templ_wobs- templ_uncarray-like
Optional uncertainties on
templ_flux- velocity_sigmafloat
Kinematic velocity width, km/s
- nsigfloat
Number of sigmas of the Gaussian convolution kernel to sample
- fill_valuefloat
Value to fill in the resampled array where no template data is available
- 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_wobswavelengths, 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