Spectroscopic parallax or main sequence fitting is an astronomical method for measuring the distances to stars.