thomasvrussell / sfft

Saccadic Fast Fourier Transform (SFFT) algorithm for Image subtraction in Fourier space
MIT License
50 stars 9 forks source link

Rewrite steps to pass CuPy arrays #5

Open wmwv opened 3 months ago

wmwv commented 3 months ago

Rewrite the individual steps to pass CuPy arrays instead of writing out and reading from disk for each intermediate step. Along the way we'll write down clearly what each step needs as input and output and what metadata we'll want to pass along to the final output even if it's not used by any intermediate step (e.g., MJD-OBS, FILTER, EXPTIME among other things).

A longer-term goal is to consider combining matrix operations from multiple steps and doing. But this issues is just about passing things in memory following the current steps.

wmwv commented 3 months ago

Images have already been ISRed and have catalogs, WCS, PSF, and photometric calibration (which we might use for normalization).

INPUT: Image 1, Variance 1, Catalog 1, PSF 1 Image 2, Variance 2, Catalog 2, PSF 2

I think the steps are

  1. Sky subtract template and science
  2. Align template images to science image
  3. Remap PSF of template to new alignment
  4. Cross-Convolve template image with science PSF, Cross-Convolve science image with template PSF. Also apply to PSFs.
  5. Solve for kernel and apply SFFT and subtract.
  6. Create Score Image

OUTPUT: Score image, Subtracted image, Convolution kernel, [Co]Variance image + matrix.

Detection happens after.