@staticmethod
def _parse_unit(unit):
    """Return the flux and velocity units for integrating spectra."""
    try:
        flux, velo = unit.split(' ')
    except ValueError:
        flux, velo = unit, None
    if flux.lower() not in ['mjy', 'jy', 'mk', 'k', 'mjy/beam', 'jy/beam']:
        raise ValueError('Unknown flux unit: {}.'.format(flux))
    if velo is not None and velo.lower() not in ['m/s', 'km/s']:
        raise ValueError('Unknown velocity unit: {}'.format(velo))
    if velo is not None:
        velo = velo.lower()
    return flux.lower(), velo
