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-20566: Replace afw.geom aliases with geom #67

Merged
merged 1 commit into from
Jul 16, 2019
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/test/makeTestRawVisitInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
__all__ = ["MakeTestRawVisitInfo"]

from lsst.afw.image import VisitInfo, RotType
from lsst.afw.geom import degrees, SpherePoint
from lsst.geom import degrees, SpherePoint
from lsst.afw.coord import Observatory, Weather
from lsst.obs.base import MakeRawVisitInfo

Expand Down
33 changes: 17 additions & 16 deletions python/lsst/obs/test/testCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import numpy as np

import lsst.afw.cameraGeom as cameraGeom
import lsst.geom as geom
import lsst.afw.geom as afwGeom
from lsst.afw.table import AmpInfoCatalog, AmpInfoTable, LL
from lsst.afw.cameraGeom import NullLinearityType
Expand Down Expand Up @@ -58,7 +59,7 @@ class TestCamera(cameraGeom.Camera):
with visit=1
"""
def __init__(self):
plateScale = afwGeom.Angle(20, afwGeom.arcseconds) # plate scale, in angle on sky/mm
plateScale = geom.Angle(20, geom.arcseconds) # plate scale, in angle on sky/mm
# Radial distortion is modeled as a radial polynomial that converts from focal plane (in mm)
# to field angle (in radians). Thus the coefficients are:
# C0: always 0, for continuity at the center of the focal plane; units are rad
Expand Down Expand Up @@ -175,9 +176,9 @@ def _makeAmpInfoCatalog(self):
}[(ampX, ampY)]
record = ampInfoCatalog.addNew()
record.setName("%d%d" % (ampX, ampY))
record.setBBox(afwGeom.Box2I(
afwGeom.Point2I(ampX * xDataExtent, ampY * yDataExtent),
afwGeom.Extent2I(xDataExtent, yDataExtent),
record.setBBox(geom.Box2I(
geom.Point2I(ampX * xDataExtent, ampY * yDataExtent),
geom.Extent2I(xDataExtent, yDataExtent),
))

x0Raw = ampX * xRawExtent
Expand All @@ -188,19 +189,19 @@ def _makeAmpInfoCatalog(self):
x0Bias = x0Raw
x0Data = x0Bias + xBiasExtent

record.setRawBBox(afwGeom.Box2I(
afwGeom.Point2I(x0Raw, y0Raw),
afwGeom.Extent2I(xRawExtent, yRawExtent),
record.setRawBBox(geom.Box2I(
geom.Point2I(x0Raw, y0Raw),
geom.Extent2I(xRawExtent, yRawExtent),
))
record.setRawDataBBox(afwGeom.Box2I(
afwGeom.Point2I(x0Data, y0Raw),
afwGeom.Extent2I(xDataExtent, yDataExtent),
record.setRawDataBBox(geom.Box2I(
geom.Point2I(x0Data, y0Raw),
geom.Extent2I(xDataExtent, yDataExtent),
))
record.setRawHorizontalOverscanBBox(afwGeom.Box2I(
afwGeom.Point2I(x0Bias, y0Raw),
afwGeom.Extent2I(xBiasExtent, yRawExtent),
record.setRawHorizontalOverscanBBox(geom.Box2I(
geom.Point2I(x0Bias, y0Raw),
geom.Extent2I(xBiasExtent, yRawExtent),
))
record.setRawXYOffset(afwGeom.Extent2I(x0Raw, y0Raw))
record.setRawXYOffset(geom.Extent2I(x0Raw, y0Raw))
record.setReadoutCorner(readCorner)
record.setGain(gain)
record.setReadNoise(readNoise)
Expand All @@ -211,6 +212,6 @@ def _makeAmpInfoCatalog(self):
record.setHasRawInfo(True)
record.setRawFlipX(False)
record.setRawFlipY(False)
record.setRawVerticalOverscanBBox(afwGeom.Box2I()) # no vertical overscan
record.setRawPrescanBBox(afwGeom.Box2I()) # no horizontal prescan
record.setRawVerticalOverscanBBox(geom.Box2I()) # no vertical overscan
record.setRawPrescanBBox(geom.Box2I()) # no horizontal prescan
return ampInfoCatalog
4 changes: 2 additions & 2 deletions tests/test_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


from lsst.afw.image.testUtils import makeRampImage
import lsst.afw.geom as afwGeom
import lsst.geom as geom
import lsst.afw.image as afwImage
import lsst.daf.persistence as dafPersist
import lsst.obs.test
Expand Down Expand Up @@ -94,7 +94,7 @@ def testPut(self):
butler = dafPersist.Butler(
inputs=dafPersist.RepositoryArgs(root=self.input, mapper='lsst.obs.test.testMapper.TestMapper'),
outputs=outputs)
bbox = afwGeom.Box2I(afwGeom.Point2I(0, 0), afwGeom.Point2I(10, 10))
bbox = geom.Box2I(geom.Point2I(0, 0), geom.Point2I(10, 10))
raw = makeRampDecoratedImage(bbox=bbox, start=100, raw1=5, raw2="hello")
flat = makeRampDecoratedImage(bbox=bbox, start=-55, flat1="me", flat2=47)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_obs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import lsst.utils.tests
from lsst.utils import getPackageDir
from lsst.afw.geom import arcseconds, Extent2I
from lsst.geom import arcseconds, Extent2I
import lsst.obs.base.tests
import lsst.obs.test

Expand Down