constant_velocity_wl_grid

tayph.constant_velocity_wl_grid(wl, fx, oversampling=1.0, minmax=[0, inf], assume_sorted=False, verbose=False)[source] [edit on github]

This function will define a constant-velocity grid that is (optionally) sampled a number of times finer than the SMALLEST velocity difference that is currently in the grid.

Example: wl_cv,fx_cv = constant_velocity_wl_grid(wl,fx,oversampling=1.5).

This function is hardcoded to raise an exception if wl or fx contain NaNs, because interp1d does not handle NaNs.

Parameters
wllist, np.ndarray

The wavelength array to be resampled.

fxlist, np.ndarray

The flux array to be resampled.

oversamplingfloat

The factor by which the wavelength array is minimally oversampled.

Returns
wlnp.array

The new wavelength grid.

fxnp.array

The interpolated flux values.

afloat

The velocity step in km/s.