def get_years(ncfiles, sep='-'):
    """
    Retrieve a list of years from a list of netCDF filenames.

    Parameters
    ----------
    ncfiles : list
        List of filenames from which years will be extracted.
    sep : TYPE, optional
        Separator. The default is '-'.

    Returns
    -------
    years : set
        List of years.

    """
    years = set([str(f).split(sep)[-1][:4] for f in ncfiles])
    return years