def detrend_feh(feh):
    """
    Calibrate trend in (Delta Fe/H = Fe/H_recovered - Fe/H_true) vs Fe/H_true
    
    INPUT:
        recovered feh value from specmatch
        
    OUTPUT:
        calibrated feh after removing trend
        
    NOTES:
        Currently correct for order 5
    """
    # Paramters for order 5
    p1 = -0.28935366
    p0 = -0.00095669
    a = (1./(p1+1.))  # 1.4071697041315936
    b = -(p0/(p1+1.)) # -0.0013462251842456543
    return a*feh + b