def drop_if_appropriate(exc):
    for field in uncertainty_fields:
        if ((field not in exc) or (exc[field] == 0)):
            continue
        elif (isinstance(exc[field], numbers.Number) and np.isnan(exc[field])):
            continue
        elif (not exc[field]):
            del exc[field]
def drop_if_appropriate(exc):
    for field in uncertainty_fields:
        if ((field not in exc) or (exc[field] == 0)):
            continue
        elif (isinstance(exc[field], numbers.Number) and np.isnan(exc[field])):
            continue
        elif (not exc[field]):
            del exc[field]