Questions about the image being subtracted in the AP pipeline

Hi all,

I have two questions regarding the image being subtracted in the AP pipeline.

  1. I didn’t find how to use the LSST pipeline to do image subtraction between two coadded images. LSST takes a pair of 15s exposures per field. LSST could combine those two exposures, and then subtract that combined (coadded) image with a template. Do you know if the LSST pipeline can perform this kind of image subtraction, or is this being developed?

  2. Is it possible that we could “reuse” existing calexps (for example the ones for building the coadd template), so then in the AP pipeline we don’t need to reprocess science raws again for image subtraction?

Any suggestions would be appreciated. Thanks.

Hi Shenming,

We don’t have a function for subtracting two coadded images in a pipeline, though should work fine in a notebook or similar environment if you supply a coadded image in place of a science image. For your specific use case of two 15s snaps, we handle that a little differently. Two or more snaps that are part of the same visit get combined into a single exposure in CalibrateImageTask in the AP pipeline, and from then on are treated as a single science exposure.

For your second question, you certainly can use the same exposures that were used to make the coadded image as the science images for subtraction. I would advise you to run coaddition and subtraction as two separate pipelines (using the same collection), and note that the difference image will have uncharacterized correlations that may not be suitable for all science cases.

1 Like

Hi Ian,

Thank you for answering my questions in such detail. I just have some follow-up questions.

In your answer to my first question, you said snaps can be combined in CalibrateImageTask in the AP pipeline. Can we use a config or yaml file to set that? Is there a tutorial on this?

For my second question, if we want to use the same exposures that were used to make the coadded image, can we just modify the config file of the AP pipeline? Or do we need to write a yaml file (to combine a few tasks) for a new pipeline?


If the input data includes snaps, CalibrateImageTask should handle them automatically. There is no configuration you need to set. This is fairly new functionality, so I’m afraid there is no tutorial available.

For your second question, I believe it would be easiest to write two separate pipeline .yaml files for coaddition and subtraction. I am not quite sure what you mean by “modify the config file of the AP pipeline”. so I may be misinterpreting your question.

1 Like

Thank you. I’m processing DECam using the LSST pipeline v26. The exposures don’t have dithering. Do you know how to “define snaps” for DECam? Do I need to adjust FITS headers? Is this functionality available in v26?

For my second question, I was wondering if I can set the config so the AP pipeline will know which calexps to use (either from the original processing or the new processing). After discussion with @antenglert , we thought we could input the collection for the original calexps and skip the single frame processing part in the AP pipeline and see if it works.

To process images as snaps with a pipeline and the butler, you need to have the images ingested in the butler with the same exposure ID. Note that CalibrateImageTask can only handle two snaps. You can also test this in a notebook or in a python shell. If you call with a list of two exposures instead of one, it will automatically process them as snaps.

1 Like