def build_flare(t12): trise = t12[t12 <= 0] tdecay = t12[t12 > 0] frise = 1 + 1.941*trise - 0.175*trise**2 - 2.246*trise**3 - 1.1225 * trise**4 fdecay = 0.6890 * np.exp(-1.6 * tdecay) + 0.3030*np.exp(-0.2783 * tdecay) return np.hstack([frise, fdecay])