Skip to content

Commit

Permalink
Add number of objects loaded to loadDiaCatalogs logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed Sep 25, 2024
1 parent 09f8d94 commit 66c279a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions python/lsst/ap/association/diaPipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def run(self,
diaObjects, _ = self.purgeDiaObjects(diffIm.getBBox(), diffIm.getWcs(), preloadedDiaObjects,
buffer=self.config.imagePixelMargin)
else:
self.log.info("Preloaded DiaObject table is empty.")
diaObjects = preloadedDiaObjects

# Associate DiaSources with DiaObjects
Expand Down
8 changes: 4 additions & 4 deletions python/lsst/ap/association/loadDiaCatalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ def loadDiaObjects(self, region, schema):
DiaObjects loaded from the Apdb that are within the area defined
by ``pixelRanges``.
"""
self.log.info("Loading DiaObjects")
diaObjects = self.apdb.getDiaObjects(region)

diaObjects.set_index("diaObjectId", drop=False, inplace=True)
Expand All @@ -230,6 +229,7 @@ def loadDiaObjects(self, region, schema):
"downstream pipeline issues. Dropping duplicated rows")
# Drop duplicates via index and keep the first appearance.
diaObjects = diaObjects.groupby(diaObjects.index).first()
self.log.info("Loaded %i DiaObjects", len(diaObjects))

return convertTableToSdmSchema(schema, diaObjects, tableName="DiaObject")

Expand Down Expand Up @@ -258,8 +258,6 @@ def loadDiaSources(self, diaObjects, region, dateTime, schema):
DiaSources loaded from the Apdb that are within the area defined
by ``pixelRange`` and associated with ``diaObjects``.
"""
self.log.info("Loading DiaSources")

diaSources = self.apdb.getDiaSources(region, diaObjects.loc[:, "diaObjectId"], dateTime)

diaSources.set_index(["diaObjectId", "band", "diaSourceId"],
Expand All @@ -275,6 +273,7 @@ def loadDiaSources(self, diaObjects, region, dateTime, schema):
diaSources.set_index(["diaObjectId", "band", "diaSourceId"],
drop=False,
inplace=True)
self.log.info("Loaded %i DiaSources", len(diaSources))

return convertTableToSdmSchema(schema, diaSources, tableName="DiaSource")

Expand All @@ -299,7 +298,6 @@ def loadDiaForcedSources(self, diaObjects, region, dateTime, schema):
DiaObjects loaded from the Apdb that are within the area defined
by ``pixelRanges``.
"""
self.log.info("Loading DiaForcedSources")

if len(diaObjects) == 0:
# If no diaObjects are available return an empty DataFrame with
Expand All @@ -326,5 +324,7 @@ def loadDiaForcedSources(self, diaObjects, region, dateTime, schema):
diaForcedSources.set_index(["diaObjectId", "diaForcedSourceId"],
drop=False,
inplace=True)
nVisits = 0 if diaForcedSources.empty else len(set(diaForcedSources["visit"]))
self.log.info("Loaded %i DiaForcedSources from %i visits", len(diaForcedSources), nVisits)

return convertTableToSdmSchema(schema, diaForcedSources, tableName="DiaForcedSource")

0 comments on commit 66c279a

Please sign in to comment.