### Navigation

- index
- modules |
- next |
- previous |
- SciPy v0.7 Reference Guide (DRAFT) »
- Image Array Manipulation and Convolution (`scipy.stsci`) »

# scipy.stsci.convolve.correlate

`scipy.stsci.convolve.``correlate`(data, kernel, mode=FULL)

      >>> correlate(np.arange(8), [1, 2], mode=VALID)
      array([ 2,  5,  8, 11, 14, 17, 20])
      >>> correlate(np.arange(8), [1, 2], mode=SAME)
      array([ 0,  2,  5,  8, 11, 14, 17, 20])
      >>> correlate(np.arange(8), [1, 2], mode=FULL)
      array([ 0,  2,  5,  8, 11, 14, 17, 20,  7])
      >>> correlate(np.arange(8), [1, 2, 3], mode=VALID)
      array([ 8, 14, 20, 26, 32, 38])
      >>> correlate(np.arange(8), [1, 2, 3], mode=SAME)
      array([ 3,  8, 14, 20, 26, 32, 38, 20])
      >>> correlate(np.arange(8), [1, 2, 3], mode=FULL)
      array([ 0,  3,  8, 14, 20, 26, 32, 38, 20,  7])
      >>> correlate(np.arange(8), [1, 2, 3, 4, 5, 6], mode=VALID)
      array([ 70,  91, 112])
      >>> correlate(np.arange(8), [1, 2, 3, 4, 5, 6], mode=SAME)
      array([ 17,  32,  50,  70,  91, 112,  85,  60])
      >>> correlate(np.arange(8), [1, 2, 3, 4, 5, 6], mode=FULL)
      array([  0,   6,  17,  32,  50,  70,  91, 112,  85,  60,  38,  20,   7])
      >>> correlate(np.arange(8), 1+1j)
      ...
      TypeError: array cannot be safely cast to required type

### Navigation

- index
- modules |
- next |
- previous |
- SciPy v0.7 Reference Guide (DRAFT) »
- Image Array Manipulation and Convolution (`scipy.stsci`) »