c3-time-domain / SeeChange

A time-domain data reduction pipeline (e.g., for handling images->lightcurves) for surveys like DECam and LS4
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

Add GAL warping for alignment #276

Open rknop opened 1 month ago

rknop commented 1 month ago

The GNU Astronomy Library has a warping module:

https://www.gnu.org/software/gnuastro/manual/html_node/Warp-library.html

I've used this before in C++ to do warping based on WCSes. I believe we could use this with the same WCSes we use with swarp. (We'll still need scamp to produce those WCSes.)

We could write a python module that shells out to a C or C++ function that uses gal to do warping. This would have the advantage over scamp that we know what it's doing. Written right, we could have it just return a numpy array, obviating the need to write out temporary files. It would also be simpler, as it would do less than scamp -- it wouldn't do coaddition, for instance.

rknop commented 1 month ago

(I am thinking about this because the disk i/o contention I was seeing with scamp. scamp was written assuming it was going to be coadding a lot of files, and so naturally just uses its own virtual memory implementation with disk space. It's documentation claims that it doesn't use its vmem if it can fit everything in memory, but I'm skeptical; it's hard to understand why we get so much disk i/o contention otherwise. By writing our own thing using the GAL, we could avoid all disk i/o internal to the warping routine.)