hanjinliu / coords-array

N-Dimensional array implemented with slicing, transformation and interpolation in a coordinate-based manner.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Support frequency axis for use with Fourier transformation. #4

Open hanjinliu opened 2 years ago

hanjinliu commented 2 years ago

In Fourier transformation, a spatial axis and its frequency axis should be considered as in relationship of duality.

import coords_array as cr

arr = cr.random.random((100, 100), coords=["y", "x"])
arr_ft = cr.fft.fftn(arr)
arr.coords[0]  # should be FrequencyAxis of Axis(name="y")

One of the prominent benefits of FrequencyAxis is that spatial scale can be automatically determined (like conversion between sec and Hz).