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

Background model #308

Closed guynir42 closed 1 week ago

guynir42 commented 3 weeks ago

Adds a Background object that saves either a map or a scalar (and later we can add a polynomial fit model) to disk and to database, that holds the information about what background needs to be subtracted from the Image.

This happens along with source detection and PSF finding, as part of the "extraction" step.

The background object joins the other image products: sources, psf, wcs, zp and now bg.

When a user wants to get an image that has its background subtracted, there would be a method in Image that uses this object to subtract the background estimate from the image (either a map of the same size as the image data, or a scalar).

If the image is already background free (e.g., it is a subtraction) then we save a "zero" background which has a single scalar value of zero, and its subtraction is a no-op.

Note that in this case a background object can still maintain an estimate of the background variance, if we can get it.

guynir42 commented 3 weeks ago

This PR addresses mainly the background model, as in issue #205. While I'm at it, I'm also fixing some issues that have to do with extraction.