Skip to content

Commit

Permalink
Switch from afw.image.Wcs to afw.geom.SkyWcs
Browse files Browse the repository at this point in the history
  • Loading branch information
r-owen committed Dec 9, 2017
1 parent 54aef19 commit e3bc176
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions bin.src/genInputRegistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
import sys

import lsst.daf.base as dafBase
import lsst.afw.image as afwImage
from lsst.afw.fits import readMetadata
from lsst.afw.geom import makeSkyWcs
import lsst.skypix as skypix

DefaultOutputRegistry = "registry.sqlite3"
Expand Down Expand Up @@ -106,7 +107,7 @@ def processRawDir(rawDir, conn, done, qsp):
nSkipped += 1
continue

md = afwImage.readMetadata(fitsPath)
md = readMetadata(fitsPath)
expTime = md.get("EXPTIME")
mjdObs = md.get("MJD-OBS")
taiObs = dafBase.DateTime(mjdObs, dafBase.DateTime.MJD,
Expand All @@ -119,7 +120,7 @@ def processRawDir(rawDir, conn, done, qsp):
id = row[0]
break

wcs = afwImage.makeWcs(md)
wcs = makeSkyWcs(md)
poly = skypix.imageToPolygon(wcs,
md.get("NAXIS1"), md.get("NAXIS2"),
padRad=0.000075) # about 15 arcsec
Expand Down
3 changes: 2 additions & 1 deletion tests/test_metadataObjectAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import unittest

import lsst.afw.image
from lsst.afw.geom import SkyWcs
import lsst.daf.persistence as dafPersist
import lsst.utils.tests
from lsst.utils import getPackageDir
Expand Down Expand Up @@ -77,7 +78,7 @@ def test(self):
calexp = butler.get('calexp', immediate=True)
self.assertIsInstance(calexp, lsst.afw.image.ExposureF)

self.assertIsInstance(wcs, lsst.afw.image.Wcs)
self.assertIsInstance(wcs, SkyWcs)
self.assertWcsAlmostEqualOverBBox(wcs, calexp.getWcs(), calexp.getBBox())

self.assertIsInstance(calib, lsst.afw.image.Calib)
Expand Down

0 comments on commit e3bc176

Please sign in to comment.