Finish analysis function, with sp.polyfit