@staticmethod
def _calculate_radial_velocity(observer, target, as_scalar=False):
    '\n        Compute the line-of-sight velocity from the observer to the target.\n\n        Parameters\n        ----------\n        observer : `~astropy.coordinates.BaseCoordinateFrame`\n            The frame of the observer.\n        target : `~astropy.coordinates.BaseCoordinateFrame`\n            The frame of the target.\n        as_scalar : bool\n            If `True`, the magnitude of the velocity vector will be returned,\n            otherwise the full vector will be returned.\n\n        Returns\n        -------\n        `~astropy.units.Quantity`\n            The radial velocity of the target with respect to the observer.\n        '
    observer_icrs = observer.transform_to(ICRS())
    target_icrs = target.transform_to(ICRS())
    pos_hat = SpectralCoord._normalized_position_vector(observer_icrs, target_icrs)
    d_vel = (target_icrs.velocity - observer_icrs.velocity)
    vel_mag = pos_hat.dot(d_vel)
    if as_scalar:
        return vel_mag
    else:
        return (vel_mag * pos_hat)
Compute the line-of-sight velocity from the observer to the target.

Parameters
----------
observer : `~astropy.coordinates.BaseCoordinateFrame`
    The frame of the observer.
target : `~astropy.coordinates.BaseCoordinateFrame`
    The frame of the target.
as_scalar : bool
    If `True`, the magnitude of the velocity vector will be returned,
    otherwise the full vector will be returned.

Returns
-------
`~astropy.units.Quantity`
    The radial velocity of the target with respect to the observer.
@staticmethod
def _calculate_radial_velocity(observer, target, as_scalar=False):
    '\n        Compute the line-of-sight velocity from the observer to the target.\n\n        Parameters\n        ----------\n        observer : `~astropy.coordinates.BaseCoordinateFrame`\n            The frame of the observer.\n        target : `~astropy.coordinates.BaseCoordinateFrame`\n            The frame of the target.\n        as_scalar : bool\n            If `True`, the magnitude of the velocity vector will be returned,\n            otherwise the full vector will be returned.\n\n        Returns\n        -------\n        `~astropy.units.Quantity`\n            The radial velocity of the target with respect to the observer.\n        '
    observer_icrs = observer.transform_to(ICRS())
    target_icrs = target.transform_to(ICRS())
    pos_hat = SpectralCoord._normalized_position_vector(observer_icrs, target_icrs)
    d_vel = (target_icrs.velocity - observer_icrs.velocity)
    vel_mag = pos_hat.dot(d_vel)
    if as_scalar:
        return vel_mag
    else:
        return (vel_mag * pos_hat)