epic-astronomy / LWA_EPIC

The LWA-specific implementation of the EPIC correlator
http://livetv.epic-astronomy.org
MIT License
3 stars 3 forks source link

DFT images differ from FFT #17

Closed mkolopanis closed 3 years ago

mkolopanis commented 3 years ago

noted in #16 the DFT images appear at first glance to be different than the FFT ones. @jaycedowell noted there may be a rotation? Also it returns a 1-D flattened array of the pixels, we should have both return a comparable product. This will help in the inclusion of DFTing some antennas and adding them to the FFT images.

jaycedowell commented 3 years ago

This line is suggestive:

# this builds a 3 x 64 x 64 matrix, need to transpose axes to [2, 1, 0] to get correct
#  64 x 64 x 3 shape
lm_matrix = numpy.asarray([i * lm_step - 1.0, j * lm_step - 1.0, numpy.zeros_like(j)])
lm_vector = lm_matrix.transpose([2, 1, 0]).reshape((self.skymodes, 3))

It may be that changing the transpose to 1, 2, 0 is all that is needed,

mkolopanis commented 3 years ago

this very well could be, I think I added this when trying to make a loop a little "smarter" wouldn't be surprised if i got it all backwards.

jaycedowell commented 3 years ago

I'll give it a try.

jaycedowell commented 3 years ago

It's a flip and a numpy.fft.fftshift in order to use the regular SaveOp.

mkolopanis commented 3 years ago

This was closed via #18