def configure_redshift(redshift, *structs):
    """
    Check and obtain a redshift from given default and structs.

    Parameters
    ----------
    redshift : float
        The default redshift to use
    structs : list of :class:`~_utils.OutputStruct`
        A number of output datasets from which to find the redshift.

    Raises
    ------
    ValueError :
        If both `redshift` and *all* structs have a value of `None`, **or** if any of them
        are different from each other (and not `None`).
    """
    zs = set()
    for s in structs:
        if s is not None and hasattr(s, 'redshift'):
            zs.add(s.redshift)
    zs = list(zs)
    if len(zs) > 1 or len(zs) == 1 and redshift is not None and zs[0
        ] != redshift:
        raise ValueError('Incompatible redshifts in inputs')
    elif len(zs) == 1:
        return zs[0]
    elif redshift is None:
        raise ValueError(
            'Either redshift must be provided, or a data set containing it.')
    else:
        return redshift
