Dears,
As mentioned in a previous topic, we are working on a pipeline for searching for optical counterparts to high-energy transients.
Because image subtraction is not easily achieved with DP1 data, we have been injecting sources directly into visit and difference images fetched by the butler, following a suggestion by @MelissaGraham Unfortunately, lsst.ip.diffim.DetectAndMeasureTask
requires a template image to run, in addition to the science and difference images. With DP0.2, these templates were provided visit-by-visit through the goodSeeingDiff_templateExp
dataset. DP1 provides no direct analogue for this dataset, and warping existing coadds into a new template has proven difficult before.
We found that DetectAndMeasureTask
completes without problems when the same visit is used for both the science and template parameters of DetectAndMeasureTask.run
. Below is a sketch of the code we are using to detect and measure sources on a DP1 difference image:
from lsst.ip.diffim.detectAndMeasure import DetectAndMeasureTask, DetectAndMeasureConfig
visit = fetch_visit(..)
difference = fetch_difference(..)
visit_injected = inject_exposure(visit)
difference_injected = inject_exposure(difference)
config: DetectAndMeasureConfig = custom_configuration()
results = DetectAndMeasureTask(config=config).run(
visit_injected,
visit_injected, # here we would have a coadd template
diff_injected
)
I have a few questions:
- Why does
DetectAndMeasureTask
require both the science and template images to run, in addition to the difference image? - What consequences should we expect from calling
DetectAndMeasureTask.run
with both the template and science parameters set to the same visit image? What benefits would we gain from calling the method with a proper coadd template instead? - Is our approach reasonable? What are the best practices for measuring sources in DP1 difference images? Is anyone else doing this, and if so, how are you approaching it?
As always, thank you!