import glob


def get_filename_lists(directory):
    """Return lists of files in the directory, separating histogram cubes
    end with '_hist.nc' from timeseries files."""
    hist_list=[]
    tseries_list=[]
    if (directory is not None) and (directory != 'None'):
        file_list=sorted(glob.glob(directory+"/*"))
        hist_list = [f for f in file_list if f.endswith("_hist.nc")]
        tseries_list = [f for f in file_list if f not in set(hist_list)]
    return hist_list, tseries_list