In CASA

The steps in CASA involve
  1. Separating spectral windows and different sources into independent (temporary) MS
  2. Getting rid of flagged data
  3. Setting the velocity reference frame and correcting for Doppler motions
  4. Exporting to UVFITS
  5. Removing the intermediate MS
The intermediate MS is created using mstransform, with keepflags=False, regridms=True, outframe='LSRK'. Source and spectral window identification is done using keywords spw and field, and an appropriate rest frequency is specified (in MHz) using restfreq. Finally, exportuvfits is used on the simple intermediate MS. IMAGER provides to CASA a tool named casagildas() that scans the content of the Measurement Set (using listobs() to automatically do this on all combinations of spectral windows and sources.