def set_cube_standard_name_if_valid(cube, standard_name):
    """
    Set a cube's standard name if it is a valid CF compliant name, otherwise set it to None
    :param cube: Cube to set standard name on
    :param standard_name: Standard name to set
    :return:
    """
    try:
        cube.standard_name = standard_name
    except ValueError:
        cube.standard_name = None
