Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

psheehan
Copy link

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
Copy link
Author

psheehan commented Dec 21, 2021

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):

  • Rename many of the new functions (interpolate_to_image, find_triangle, find_triangle_directed_walk, find_triangle_bruteforce) to *_h, with the intention of eventually adding *_d counterparts for symmetry (if efficient on GPUs)
  • Break interpolate_to_image into several sub-functions for ease of reading
  • Currently there is only a sample_unstructured_image, but should there eventually be others like chi2_unstructured_image (for example) for symmetry?
  • Should any of the functions be exposed in the interface for experts? Perhaps interpolate_to_image?

@psheehan
Copy link
Author

psheehan commented Mar 10, 2022

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:

  • Do the new functions all look good? Do any need to be further split up?
  • Currently there is only a sample_unstructured_image, but should there eventually be others like chi2_unstructured_image (for example) for symmetry?
  • Should any of the functions be exposed in the interface for experts? Perhaps unstructured_to_grid_h?
  • Is there a better/more formal place/way to include the tests? I see a python/test_galario.py and a src/galario_test.cpp, and also a python/speed_benchmark.py - not sure if it would be ideal to add similar tests to whatever is done in those?
  • Is there anything else the needs to be done to get this merge-ready?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant