def correct_thresholds(p):
    """
    Checks that the thresholds are ordered th_lo < th < th_hi
    """
    return ( (p['th_lo'] < p['th']) or p['th'] == -1 ) and \
            ( (p['th'] < p['th_hi']) or p['th_hi'] == -1 )