def get_latitude(dataset):
    """Get latitude dimension from XArray dataset object."""
    for dim_name in ['lat', 'latitude']:
        if dim_name in dataset.coords:
            return dataset[dim_name]
    raise RuntimeError('Could not find latitude dimension in dataset.')