Predicate function encapsulating 'data clean up' filter code.

    Currently minimal, but these sort of functions tend to grow over time.

    Problem 1:
        Some of the GCN packets have an RA /Dec equal to (0,0) in the WhereWhen,
        and a flag in the What signifying that those are actually dummy co-ords.
        (This is used for time-stamping an event which is not localised).
        So, we don't load those positions, to avoid muddying the database
        corpus.
    Problem 2:
        com.dc3/dc3.broker#BrokerTest packets have dummy RA/Dec values,
        with no units specified.
        (They're also marked role=test, so it's not such a big deal,
        but it generates a lot of debug-log churn.)

def _has_bad_coords(root, stream):
    """
    Predicate function encapsulating 'data clean up' filter code.

    Currently minimal, but these sort of functions tend to grow over time.

    Problem 1:
        Some of the GCN packets have an RA /Dec equal to (0,0) in the WhereWhen,
        and a flag in the What signifying that those are actually dummy co-ords.
        (This is used for time-stamping an event which is not localised).
        So, we don't load those positions, to avoid muddying the database
        corpus.
    Problem 2:
        com.dc3/dc3.broker#BrokerTest packets have dummy RA/Dec values,
        with no units specified.
        (They're also marked role=test, so it's not such a big deal,
        but it generates a lot of debug-log churn.)
    """
    if stream == "com.dc3/dc3.broker":
        return True
    if not stream.split('/')[0] == 'nasa.gsfc.gcn':
        return False
    toplevel_params = vp.get_toplevel_params(root)
    if "Coords_String" in toplevel_params:
        if (toplevel_params["Coords_String"]['value'] ==
                "unavailable/inappropriate"):
            return True

    return False