Questions about background subtraction and reference catalog

Dear all, I was wondering if I could ask some questions about LSST DM. I was reprocessing DECam archive data with obs_decam in weekly release w_2019_05.

  1. calexps are generated at different steps of the pipeline: processCcd, assembleCoadd, detectCoaddSources, etc. Are those calexp images all background-subtracted (default)? However, I found the config of detectCoaddSources has
# Do temporary wide (large-scale) background subtraction before footprint detection?                               
config.detection.doTempWideBackground=True

# Enable temporary local background subtraction? (see tempLocalBackground)                                         
config.detection.doTempLocalBackground=True

But the config of processCcd has

config.charImage.detection.doTempLocalBackground=False
config.charImage.detection.doTempWideBackground=False
config.calibrate.detection.doTempLocalBackground=False
config.calibrate.detection.doTempWideBackground=False

and the config of assembleCoadd has

config.clipDetection.doTempWideBackground=False
config.clipDetection.doTempLocalBackground=False

Do these mean that the calexps generated by processCcd and assembleCoadd are not background-subtracted? Is the “background subtraction” used for the output catalog or for the generated calexp images?

  1. For reference catalogs (Gaia, PS1, SDSS), which calibrate astrometry and photometry, they are used in processCcd, jointcal, measureCoaddSources. In processCcd, it is given by
config.calibrate.astromRefObjLoader
config.calibrate.photoRefObjLoader

In jointcal, it is given by

config.astrometryRefObjLoader
config.photometryRefObjLoader

But in measureCoaddSources, it is only given by (does it include both astrometry and photometry?)

config.match.refObjLoader

Are processCcd, jointcal, and measureCoaddSources the only three places we should import reference catalog?
A related question is, how to import color terms (to convert color info from reference catalog to DECam)? In processCcd, we have

config.calibrate.photoCal.applyColorTerms = True
config.calibrate.photoCal.colorterms

But I don’t know how to include them in jointcal and measureCoaddSources configs. Can the color terms for these steps be inherited from processCcd?

Thank you.

First off, do you have decam colorterms? The alert pipelines group at UW would be very interested to get those into the stack!

Once you have decam colorterms for a given reference catalog (see obs_subaru/configs/hsc/colorterms.py for a working example), the only change you should need to make to use them with jointcal is to add a line like the following to the decam jointcal config:

config.colorterms.load(os.path.join(getPackageDir("obs_decam"), "config", "colorterms.py"))

Excellent questions, Shenming! Welcome to the community forums.

For (1), My understanding is that the doTempWideBackground and doTempLocalBackground config settings are for special cases of how to handle background subtraction, and that all calexps (i.e., processed visit images) are typically background subtracted. But maybe others can chime in here with more details about this.

Regarding (2), I have only just realized that obs_decam lacks the color terms you describe. If you have DECam color terms for PS1 reference catalogs, I would be thrilled to add them as @parejkoj describes so we can both use them in processCcd. (Right now I believe it tries to apply color terms, but doesn’t find any, so effectively skips that step.)

Thank you!

I was using DECam color terms (PS1 to DECam) from “grz Photometry” in http://legacysurvey.org/dr7/description/

I haven’t found other color terms for DECam yet. I will let you know once I find it.

Thank you Meredith! This is my first time to post on community forum. Thanks for your answer to (1). For (2) I only have color terms from Legacy survey’s website. I will try to find other color terms and let you know.

1 Like

These options are primarily used when detecting on very deep coadd images; they’re different (not mutually exclusive) ways of intentionally, temporarily oversubtracting the wings of real objects in order to make blends smaller. I believe they should both be disabled for single-epoch processing. And even if they are enabled, after detection is completed those subtractions are reverted, so they should only affect the detected footprints, not the final background.

1 Like

https://iopscience.iop.org/article/10.3847/1538-4365/aaa3e2/pdf provides a slightly more comprehensive set of DeCAM-PS1 color terms.

2 Likes