build_lbda#
- build_lbda(spectral_range, spectral_resolution=None, wsol=None, dsol=None, npx_resolution=2)[source]#
Build the wavelength coordinates.
This computes the mid-bin wavelengths (
lbda) and the bin edge wavelengths (lbda_edges), either from a constant resolving power (ifwsolis None, seelbda_from_resolution_power) or from a wavelength/dispersion solution.- Parameters:
spectral_range (
tupleoffloat) – Spectral domain(wmin, wmax), in Angstrom.spectral_resolution (
float, optional) – Resolving power R. Used (and required) only ifwsolis None. Default is None.wsol (callable, optional) – Wavelength solution (pixel -> wavelength in Angstrom). Default is None.
dsol (callable, optional) – Dispersion solution (wavelength in Angstrom -> pixel). Required if
wsolis given. Default is None.npx_resolution (
float, optional) – Number of pixels per spectral resolution element. Only used ifwsolis None. Default is 2.
- Returns:
lbda (
numpy.ndarray) – Mid-bin wavelengths, in Angstrom.lbda_edges (
numpy.ndarray) – Bin edge wavelengths, in Angstrom.