Finalize background subtraction observing Template, location in workflow, the algorithm, the recipe and the drl function and the data item
TODO:
-
check that order of multiplicative (flatfielding and illumination correction) and additive (background subtraction) operations are done in right order -
update manual version of association matrix -
communicate new template with ICS team
OUTDATED TEXT BELOW:
The current background subtraction is incorrect.
Currently all science dithers are used to create a single large background image that spans the whole observation (that is, with the same footprint as a stacked image), from which the background for each individual frame is cut.
What instead should happen is that we consider any structure in the background to be unchanging with small changes in pointing. So the main procedure will be this:
- Take a few dithered exposures offset a bit from the science observation.
- Do some preprocessing (TBD, see #67 (closed) and #45 (closed)), dark, flatfield, illumination correction.
- Determine the background from that for each detector. E.g. by median averaging.
- Use that background image to subtract from the science images.
Note that it is possible to use this procedure when the offset is 0, that is, to use the science images themselves. E.g. this would be possible for sparse fields of point sources.
The assumptions that go into this approach are that the background
- either is constant over the field of view, that is, a single number,
- or that the structure of the background (e.g. a gradient) does not change within the offset, this probably means that the background is either off-axis or a linear gradient over the field of views of the science and offset observation,
- and only changes slowly over time, that is, it is constant between the science observation and the offset observation, but potentially varies over a night.
Adapting to this workflow will also affect (and probably simplify)
- #76 (closed), about the modularity of the Detrend and DetrendFinal recipes, because this change can at the same time both a) make it easier to create just 1 Detrend recipe (the detrending of the science data can be done in a single combined recipe, because the background determination is performed on a different observation), and b) provide a rational to keep them separate (the background determination only requires the 'detrend' part, not the 'detrendfinal' part), TBD,
- #19 (closed), about adding a background layer to the science images, this is now not particularly useful, as the same detector will always have the same background, so adding it to each exposure will just duplicate data, so it will be better to keep the background in a separate data product,
- maybe #67 (closed), about background subtraction of photometric reference fields, but not sure
- maybe #45 (closed), grasp ordering of background subtraction and illum correction, which is similar to #67 (closed)
@verdoes I've assigned this to me, as I'll work on this. Can you verify that the above is what we agreed upon?
Another action item on us is to look at some backgrounds from similar instruments.