Optical depth localization of nitrogen-vacancy centers in diamond with nanometer accuracy