def get_longitudes(pnt, lon, rad=3.0):
    """
    Selects longitudes from a list of pointings

    Parameters
    ----------
    pnt : list of dict
        Pointings
    lon : float
        Galactic longitude (deg)
    rad : float, optional
        Selection radius (deg)

    Returns
    -------
    pnt : list of dict
        Pointings
    """
    # Initialise list of pointings
    pointings = []

    # Loop over all pointings
    for p in pnt:

        # Compute longitude difference
        dl = p['l'] - lon
        if dl > 180.0:
            dl -= 360.0
        if dl < -180.0:
            dl += 360.0

        # Append pointing if close to requested longitude
        if abs(dl) < rad:
            pointings.append(p)

    # Return pointings
    return pointings