Determination of linear optics functions from turn-by-turn data