def get_longitude(dataset):
    """Get longitude dimension from XArray dataset object."""
    for dim_name in ['lon', 'long', 'longitude']:
        if dim_name in dataset.coords:
            return dataset[dim_name]
    raise RuntimeError('Could not find longitude dimension in dataset.')