fixed traces near peak detection

Created scripts for producing figure 2-3.