@u.quantity_input(radial_velocity=(u.km / u.s))
def __new__(cls, value, unit=None, observer=None, target=None, radial_velocity=None, redshift=None, **kwargs):
    obj = super().__new__(cls, value, unit=unit, **kwargs)
    if ((target is not None) and (observer is not None)):
        if ((radial_velocity is not None) or (redshift is not None)):
            raise ValueError('Cannot specify radial velocity or redshift if both target and observer are specified')
    if (redshift is not None):
        if (radial_velocity is not None):
            raise ValueError('Cannot set both a radial velocity and redshift')
        redshift = u.Quantity(redshift)
        if (not redshift.unit.is_equivalent(u.one)):
            raise u.UnitsError('redshift should be dimensionless')
        radial_velocity = _redshift_to_velocity(redshift)
    if (observer is None):
        observer = getattr(value, 'observer', None)
    if (target is None):
        target = getattr(value, 'target', None)
    if ((observer is None) or (target is None)):
        if (radial_velocity is None):
            radial_velocity = getattr(value, 'radial_velocity', None)
    obj._radial_velocity = radial_velocity
    obj._observer = cls._validate_coordinate(observer, label='observer')
    obj._target = cls._validate_coordinate(target, label='target')
    return obj
@u.quantity_input(radial_velocity=(u.km / u.s))
def __new__(cls, value, unit=None, observer=None, target=None, radial_velocity=None, redshift=None, **kwargs):
    obj = super().__new__(cls, value, unit=unit, **kwargs)
    if ((target is not None) and (observer is not None)):
        if ((radial_velocity is not None) or (redshift is not None)):
            raise ValueError('Cannot specify radial velocity or redshift if both target and observer are specified')
    if (redshift is not None):
        if (radial_velocity is not None):
            raise ValueError('Cannot set both a radial velocity and redshift')
        redshift = u.Quantity(redshift)
        if (not redshift.unit.is_equivalent(u.one)):
            raise u.UnitsError('redshift should be dimensionless')
        radial_velocity = _redshift_to_velocity(redshift)
    if (observer is None):
        observer = getattr(value, 'observer', None)
    if (target is None):
        target = getattr(value, 'target', None)
    if ((observer is None) or (target is None)):
        if (radial_velocity is None):
            radial_velocity = getattr(value, 'radial_velocity', None)
    obj._radial_velocity = radial_velocity
    obj._observer = cls._validate_coordinate(observer, label='observer')
    obj._target = cls._validate_coordinate(target, label='target')
    return obj