exclude negative points for the fitting to avoid nan