def check_coordinate_system(coordinate_system, valid_coord_systems=(
    'cartesian', 'spherical')):
    """
    Check if the coordinate system is a valid one.

    Parameters
    ----------
    coordinate_system : str
        Coordinate system to be checked.
    valid_coord_system : tuple or list (optional)
        Tuple or list containing the valid coordinate systems.
        Default (``cartesian``, ``spherical``).
    """
    if coordinate_system not in valid_coord_systems:
        raise ValueError('Coordinate system {} not recognized.'.format(
            coordinate_system))
