def get_hi_file_at_long(longitude, sgps_hi_file_list, edge_size=0.5):
    """
    Identify the best SGPS file to retrieve data from at the supplied Galactic
    longitude. Will try to find a file where the longitude is at least edge_size
    away from the edge of the cube, but will fall back to any file with data
    covering that longtidue. Negative and positive longitudes for the third and
    fourth quadrants are automatically handled.
    :param longitude: The galactic longitude in decimal degrees, may be in the
                      range -180 < l < 360
    :param sgps_hi_file_list: A list of dictionaries describing the SGPS files.
    :param edge_size: The sie around the edge to, ideally, avoid.
    :return:
    """
    actual_long = longitude if longitude >= 0 else 360.0 + longitude
    for entry in sgps_hi_file_list:
        if entry['min_long']+edge_size < actual_long < entry['max_long']-edge_size:
            return entry['file_name']

    # Fallback to no buffer if there are no files with this value away
    # from the edges
    if edge_size > 0.0:
        return get_hi_file_at_long(actual_long, sgps_hi_file_list, edge_size=0.0)

    # We don't have coverage for this longitude
    return None