Is there a fast way to recreate the association.db file in the ApPipe?

Hello, the community forum! Again, I’ve been trying to run the LSST science (AP) pipeline on DECam images, and especially on the DES SN observations for comparison.

Out of ignorance, I have been deleting the ./apdb/association.db files that were created from the test runs, that contained all of the detections and forced measurements. I did keep all of the output in the ./repo files, thinking that I could read in all of the output using Butler. I have not been able to find forced source measurements from the output in ./repo, except in ./apdb/association.db (which I didn’t keep from previous runs). Is there an easy way to recreate the ./apdb/association.db files from the runs?

1 Like

Forced source measurements are in the butler as goodSeeingDiff_diaForcedSrc (or dia_forced_source_apdb in the current weekly).

That’s really good to know! Thanks!

I had tried to use this table before, but got errors like below, so I thought the table didn’t exist (I used deep coadd image as template, instead of goodSeeing coadd)

MissingDatasetTypeError(f"Dataset type with name ‘{name}’ not found.")
lsst.daf.butler.registry._exceptions.MissingDatasetTypeError: “Dataset type with name ‘deepDiff_diaForcedSrc’ not found.”

Does the following lines look like the right way to access the table?

dataId = {‘instrument’: ‘DECam’, ‘visit’: expo, ‘detector’: ccdnum}
diaSourceTable = butler.get(‘deepDiff_diaForcedSrc’, dataId=dataId)

Make sure you use the correct names that Eric provided, either goodSeeingDiff_diaForcedSrc for an older run or dia_forced_source_apdb if you are using a stack from weekly w_2025_16 or later. The problem is that you are looking for deepDiff_diaForcedSrc.