MCPcopy
hub / github.com/numpy/numpy / original_fftshift

Method original_fftshift

numpy/fft/tests/test_helper.py:90–104  ·  view source on GitHub ↗

How fftshift was implemented in v1.14

(x, axes=None)

Source from the content-addressed store, hash-verified

88 from numpy._core import arange, asarray, concatenate, take
89
90 def original_fftshift(x, axes=None):
91 """ How fftshift was implemented in v1.14"""
92 tmp = asarray(x)
93 ndim = tmp.ndim
94 if axes is None:
95 axes = list(range(ndim))
96 elif isinstance(axes, int):
97 axes = (axes,)
98 y = tmp
99 for k in axes:
100 n = tmp.shape[k]
101 p2 = (n + 1) // 2
102 mylist = concatenate((arange(p2, n), arange(p2)))
103 y = take(y, mylist, k)
104 return y
105
106 def original_ifftshift(x, axes=None):
107 """ How ifftshift was implemented in v1.14 """

Callers

nothing calls this directly

Calls 3

asarrayFunction · 0.90
concatenateFunction · 0.90
takeFunction · 0.90

Tested by

no test coverage detected