mtazzari / galario

Gpu Accelerated Library for Analysing Radio Interferometer Observations
https://mtazzari.github.io/galario/
GNU Lesser General Public License v3.0
31 stars 15 forks source link

Add routine to Fourier transform collection of (x, y, flux) sampled randomly #195

Open psheehan opened 2 years ago

psheehan commented 2 years ago

Per our discussion over e-mail, this pull request is meant to add functionality to galario so that it can take the Fourier transform of an "unstructured image", i.e. a list of (x, y, flux) where (x,y) do not need to fall on a regularly sampled grid. It does so by triangulating the collection of points and using the triangulation to interpolate onto a regular grid. Once that is done, the regular routines in galario can be used to do the Fourier transform and then to sample onto the relevant baselines.

psheehan commented 2 years ago

On my end, the code seems to work, but needs to be restructured to better fit the organization/layout of the galario code. The changes I think I need to make (though input/feedback welcome):

psheehan commented 2 years ago

Ok, I spent some time today renaming most of the new functions to have an _h suffix to indicate that they are run on the host. I also split interpolate_to_image into four smaller functions (triangulate_h, bin_triangles_h, interpolate_on_triangle_h, and interpolate_or_bin_to_image_h), and renamed interpolate_to_image => unstructured_to_grid_h. I think these are more or less the smallest pieces that these functions can reasonably be broken up into... but I could imagine that changing if we ever look into whether is part of the code could go onto a GPU.

Also added a few test scripts that I've been using to test that the code works properly.

A few questions I still have/places I still need help that might require some discussion: