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-46382: Add number of objects loaded to loadDiaCatalogs logs. #239

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Loading