Open psheehan opened 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):
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)interpolate_to_image
into several sub-functions for ease of readingsample_unstructured_image
, but should there eventually be others like chi2_unstructured_image
(for example) for symmetry?interpolate_to_image
?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:
sample_unstructured_image
, but should there eventually be others like chi2_unstructured_image
(for example) for symmetry?unstructured_to_grid_h
?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?
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.