Context. The CARMENES survey is a high-precision radial velocity (RV) programme that aims to detect Earth-like planets orbiting low-mass stars. Aims. We develop least-squares fitting algorithms to derive the RVs and additional spectral diagnostics implemented in the SpEctrum Radial Velocity AnaLyser (SERVAL), a publicly available python code. Methods. We measured the RVs using high signal-to-noise templates created by coadding all available spectra of each star. We define the chromatic index as the RV gradient as a function of wavelength with the RVs measured in the echelle orders. Additionally, we computed the differential line width by correlating the fit residuals with the second derivative of the template to track variations in the stellar line width. Results. Using HARPS data, our SERVAL code achieves a RV precision at the level of 1 m/s. Applying the chromatic index to CARMENES data of the active star YZ CMi, we identify apparent RV variations induced by stellar activity. The differential line width is found to be an alternative indicator to the commonly used full width half maximum. Conclusions. We find that at the red optical wavelengths (700-900 nm) obtained by the visual channel of CARMENES, the chromatic index is an excellent tool to investigate stellar active regions and to identify and perhaps even correct for activity-induced RV variations.
- Methods: data analysis
- Planets and satellites: detection
- Techniques: radial velocities
- Techniques: spectroscopic