def to_cfradial2(volume, filename, timestep=None):
    """ Save XRadVol/XRadVolume to CfRadial2.0 compliant file.

    Parameters
    ----------
    volume : XRadVol/XRadVolume object
    filename : str
        output filename
    timestep : int
        timestep of wanted volume
    """
    volume.root.load()
    root = volume.root.copy(deep=True)
    root.attrs['Conventions'] = 'Cf/Radial'
    root.attrs['version'] = '2.0'
    root.to_netcdf(filename, mode='w', group='/')
    for idx, key in enumerate(root.sweep_group_name.values):
        try:
            swp = volume[key]
        except TypeError:
            swp = volume[idx][timestep].data
        swp.load()
        dims = list(swp.dims)
        dims.remove('range')
        dim0 = dims[0]
        try:
            swp = swp.swap_dims({dim0: 'time'})
        except ValueError:
            swp = swp.drop_vars('time').rename({'rtime': 'time'})
            swp = swp.swap_dims({dim0: 'time'})
        swp.drop_vars(['x', 'y', 'z', 'gr', 'rays', 'bins'], errors='ignore')
        swp.to_netcdf(filename, mode='a', group=key)
