Data reduction pipeline for radio interferometry