Methods for robust measurements in low signal-to-noise systems and their application to nematode mechanoreceptors