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-43509: Switch to astropy.time in calls to Apdb methods #203

Merged
merged 1 commit into from
Mar 28, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/lsst/ap/association/diaPipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def run(self,
# Store DiaSources, updated DiaObjects, and DiaForcedSources in the
# Apdb.
self.apdb.store(
DateTime.now(),
DateTime.now().toAstropy(),
diaCalResult.updatedDiaObjects,
associatedDiaSources,
diaForcedSources)
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/ap/association/loadDiaCatalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def loadDiaSources(self, diaObjects, region, dateTime, apdb):
"band",
"diaSourceId"])
else:
diaSources = apdb.getDiaSources(region, diaObjects.loc[:, "diaObjectId"], dateTime)
diaSources = apdb.getDiaSources(region, diaObjects.loc[:, "diaObjectId"], dateTime.toAstropy())

diaSources.set_index(["diaObjectId", "band", "diaSourceId"],
drop=False,
Expand Down Expand Up @@ -231,7 +231,7 @@ def loadDiaForcedSources(self, diaObjects, region, dateTime, apdb):
diaForcedSources = apdb.getDiaForcedSources(
region,
diaObjects.loc[:, "diaObjectId"],
dateTime)
dateTime.toAstropy())

diaForcedSources.set_index(["diaObjectId", "diaForcedSourceId"],
drop=False,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_loadDiaCatalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def setUp(self):
self.exposure)

self.dateTime = self.exposure.visitInfo.date
self.apdb.store(self.dateTime,
self.apdb.store(self.dateTime.toAstropy(),
self.diaObjects,
self.diaSources,
self.diaForcedSources)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_packageAlerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _roundTripThroughApdb(objects, sources, forcedSources, dateTime):
Set of test DiaSources to round trip.
forcedSources : `pandas.DataFrame`
Set of test DiaForcedSources to round trip.
dateTime : `lsst.daf.base.DateTime`
dateTime : `astropy.time.Time`
Time for the Apdb.

Returns
Expand Down Expand Up @@ -200,7 +200,7 @@ def setUp(self):
diaObjects,
diaSourceHistory,
diaForcedSources,
self.exposure.visitInfo.date)
self.exposure.visitInfo.date.toAstropy())
self.diaObjects.replace(to_replace=[None], value=np.nan, inplace=True)
diaSourceHistory.replace(to_replace=[None], value=np.nan, inplace=True)
self.diaForcedSources.replace(to_replace=[None], value=np.nan,
Expand Down