Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-21886: Create PipelineTask driver for ap_pipe tasks that interact with the APDB #49

Merged
merged 1 commit into from
Dec 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 14 additions & 8 deletions python/lsst/ap/pipe/ap_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,22 +315,28 @@ def runAssociation(self, sensorRef):
diaSources = self.diaSourceDpddifier.run(catalog,
diffim,
return_pandas=True)
# Load the DiaObjects and DiaSource history. If this values it is due
# Load the DiaObjects and DiaSource history. If this fails it is due
# to an improperly set up Apdb hence we don't want it caught by the
# try clause.
loaderResult = self.diaCatalogLoader.run(diffim, self.apdb)

try:
results = self.associator.run(diaSources,
loaderResult.diaObjects,
loaderResult.diaSources,
diffim,
self.apdb)
self.diaForcedSource.run(
results.dia_objects,
loaderResult.diaSources)
diaForcedSources = self.diaForcedSource.run(
results.diaObjects,
sensorRef.get("ccdExposureId_bits"),
sensorRef.get("calexp"),
diffim,
self.apdb)
diffim)

# Store DiaSources, updated DiaObjects, and DiaForcedSources in the
# Apdb.
self.apdb.storeDiaSources(results.diaSources)
self.apdb.storeDiaObjects(
results.updatedDiaObjects,
diffim.getInfo().getVisitInfo().getDate().toPython())
self.apdb.storeDiaForcedSources(diaForcedSources)
finally:
# apdb_marker triggers metrics processing; let them try to read
# something even if association failed
Expand Down