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-9004: Check uses of darktime for NAN #48

Merged
merged 2 commits into from
Jan 16, 2017
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/obs/hsc/hscMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def std_raw(self, item, dataId):

def std_dark(self, item, dataId):
exposure = self._standardizeExposure(self.calibrations['dark'], item, dataId, trimmed=False)
visitInfo = afwImage.makeVisitInfo(exposureTime=1.0)
visitInfo = afwImage.makeVisitInfo(exposureTime=1.0, darkTime=1.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. However, I am curious why darks don't already have correct exposure time (at least), a question that is out of scope, but left over from when I first added VisitInfo support to obs_subaru.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dark construction script has never set the dark time. I'll address that in DM-8913.

exposure.getInfo().setVisitInfo(visitInfo)
return exposure

Expand Down
1 change: 1 addition & 0 deletions python/lsst/obs/hsc/makeHscRawVisitInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def setArgDict(self, md, argDict):
)
LST = self.popAngle(md, "LST-STR", units=astropy.units.h)
argDict['era'] = self.eraFromLstAndLongitude(LST, self.observatory.getLongitude())
argDict['darkTime'] = argDict['exposureTime']

def getDateAvg(self, md, exposureTime):
"""Return date at the middle of the exposure
Expand Down
3 changes: 3 additions & 0 deletions tests/testRepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def setUp(self):
self.rawSize = (2144, 4241)
self.ccdSize = (2048, 4176)
self.exptime = 30.0
self.darktime = self.exptime # No explicit darktime
dateBeg = DateTime(56598.26106374757, DateTime.MJD, DateTime.UTC)
dateAvgNSec = dateBeg.nsecs() + int(0.5e9*self.exptime)
self.dateAvg = DateTime(dateAvgNSec, DateTime.TAI)
Expand Down Expand Up @@ -135,6 +136,8 @@ def testRaw(self):
self.assertAlmostEqual(visitInfo.getBoresightAirmass(), self.boresightAirmass)
self.assertTrue(math.isnan(visitInfo.getBoresightRotAngle().asDegrees()))
self.assertEqual(visitInfo.getRotType(), self.rotType)
self.assertEqual(visitInfo.getExposureTime(), self.exptime)
self.assertEqual(visitInfo.getDarkTime(), self.darktime)
observatory = visitInfo.getObservatory()
self.assertAnglesNearlyEqual(observatory.getLongitude(), self.obs_longitude)
self.assertAnglesNearlyEqual(observatory.getLatitude(), self.obs_latitude)
Expand Down