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-14885: Use either nanoseconds or MJD in PPDB CcdVisit table #20

Merged
merged 1 commit into from
Jun 26, 2018
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
6 changes: 4 additions & 2 deletions python/lsst/ap/association/afwUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import lsst.afw.table as afwTable
import lsst.afw.image as afwImage
from lsst.daf.base import DateTime


"""Defines afw schemas and conversions for use in ap_association tasks.
Expand Down Expand Up @@ -141,6 +142,7 @@ def get_ccd_visit_info_from_exposure(exposure):
List values representing info taken from the exposure.
"""
visit_info = exposure.getInfo().getVisitInfo()
date = visit_info.getDate()
sphPoint = exposure.getWcs().getSkyOrigin()
# TODO: Calib is going away and being replaced with photoCalib as in
# DM-10153.
Expand All @@ -153,7 +155,7 @@ def get_ccd_visit_info_from_exposure(exposure):
# RA WCS center ``degrees``,
# DEC WCS center ``degrees``,
# exposure time ``seconds``,
# dateTimeMJD ``seconds``,
# dateTimeMJD ``days``,
# flux zero point ``counts``,
# flux zero point error ``counts``]
values = {'ccdVisitId': visit_info.getExposureId(),
Expand All @@ -163,7 +165,7 @@ def get_ccd_visit_info_from_exposure(exposure):
'ra': sphPoint.getRa().asDegrees(),
'decl': sphPoint.getDec().asDegrees(),
'expTime': visit_info.getExposureTime(),
'expMidptMJD': visit_info.getDate().nsecs() * 10 ** -9,
'expMidptMJD': date.get(system=DateTime.MJD),
'fluxZeroPoint': flux0,
'fluxZeroPointErr': flux0_err,
'photoCalib': afwImage.PhotoCalib(1 / flux0,
Expand Down