def evaluate_velocity_at_top(layer, prop):
    """
    Evaluate material properties at top of a velocity layer.

    .. seealso:: :func:`evaluate_velocity_at_bottom`,
        :func:`evaluate_velocity_at`

    :param layer: The velocity layer to use for evaluation.
    :type layer: :class:`~numpy.ndarray`, dtype = :py:const:`.VelocityLayer`
    :param prop: The material property to evaluate. One of:

        * ``p``
            Compressional (P) velocity (km/s)
        * ``s``
            Shear (S) velocity (km/s)
        * ``r`` or ``d``
            Density (g/cm^3)
    :type prop: str

    :returns: The value of the material property requested.
    :rtype: :class:`~numpy.ndarray` (dtype = :class:`float`, shape equivalent
        to ``layer``)
    """
    prop = prop.lower()
    if prop == 'p':
        return layer['top_p_velocity']
    elif prop == 's':
        return layer['top_s_velocity']
    elif prop in 'rd':
        return layer['top_density']
    raise ValueError('Unknown material property, use p, s, or d.')
