Highly precise determination of optical constants and sample thickness in terahertz time-domain spectroscopy | Synapse