wlen_solution#
- excalibuhr.utils.wlen_solution(fluxes, errs, w_init, transm_spec, order=2, p_range=[0.5, 0.05, 0.01], cont_smooth_len=101, debug=False)[source]#
Method for refining wavelength solution using a quadratic polynomial correction Poly(p0, p1, p2). The optimization is achieved by maximizing cross-correlation functions between the spectrum and a telluric transmission model on a order-by-order basis.
- Parameters:
fluxes (array) – flux of observed spectrum in each spectral order
w_init (array) – initial wavelengths of each spectral order
p0_range (float) – the absolute range of the 0th polynomial coefficient
p1_range (float) – the absolute range of the 1th polynomial coefficient
p2_range (float) – the absolute range of the 2th polynomial coefficient
cont_smooth_len (int) – the window length used in the high-pass filter to remove the continuum of observed spectrum
debug (bool) – if True, print the best fit polynomial coefficients.
- Returns:
wlens – the refined wavelength solution
- Return type:
array