docstr: Verify that peak locations are (approximately) found
  for a series of gaussians with added noise.
docstr_tok: ["Verify","that","peak","locations","are","(","approximately",")","found","for","a","series","of","gaussians","with","added","noise","."]
code: def test_find_peaks_withnoise(self):
      """
      Verify that peak locations are (approximately) found
      for a series of gaussians with added noise.
      """
      sigmas = [5.0, 3.0, 10.0, 20.0, 10.0, 50.0]
      num_points = 500
      test_data, act_locs = _gen_gaussians_even(sigmas, num_points)
      widths = np.arange(0.1, max(sigmas))
      noise_amp = 0.07
      np.random.seed(18181911)
      test_data += (np.random.rand(num_points) - 0.5) * (2 * noise_amp)
      found_locs = find_peaks_cwt(
          test_data,
          widths,
          min_length=15,
          gap_thresh=1,
          min_snr=noise_amp / 5,
      )
  
      np.testing.assert_equal(
          len(found_locs),
          len(act_locs),
          "Different number" + "of peaks found than expected",
      )
      diffs = np.abs(found_locs - act_locs)
      max_diffs = np.array(sigmas) / 5
      np.testing.assert_array_less(
          diffs,
          max_diffs,
          "Maximum location differed" + "by more than %s" % (max_diffs),
      )
  
imports: from __future__ import division, print_function, absolute_import
  import copy
  import numpy
  from numpy.testing import assert_, assert_equal, assert_allclose, assert_array_equal
  import pytest
  from pytest import raises, warns
  from scipy._lib.six import xrange
  from scipy.signal._peak_finding import argrelmax, argrelmin, peak_prominences, peak_widths, _unpack_condition_args, find_peaks, find_peaks_cwt, _identify_ridge_lines
  from scipy.signal._peak_finding_utils import _local_maxima_1d, PeakPropertyWarning
label_desc: Use image node_id 2 for calling the TestFindPeaksCwt obj's underlying member method code with example usage: obj.test_find_peaks_withnoise() without return types