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-11162: Replace all use of Coord and subclasses with SpherePoint #6

Merged
merged 1 commit into from
Mar 23, 2018
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
8 changes: 3 additions & 5 deletions python/lsst/synpipe/makeRaDecCat.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def getRandomRaDec(nRand, minRa, maxRa, minDec, maxDec, rad=None):
decArr = uniform(low=minDec, high=maxDec, size=nRand)
return list(zip(raArr, decArr))
else:
import lsst.afw.coord as afwCoord
import lsst.afw.geom as afwGeom

minSep = float(rad)
Expand All @@ -86,13 +85,12 @@ def getRandomRaDec(nRand, minRa, maxRa, minDec, maxDec, rad=None):
else:
raTry = uniform(low=minRa, high=maxRa)
decTry = uniform(low=minDec, high=maxDec)
coordTry = afwCoord.Coord(afwGeom.Point2D(raTry, decTry))
coordTry = afwGeom.SpherePoint(raTry, decTry, afwGeom.degrees)
nExist = len(raArr)
sepGood = True
for ii in range(nExist):
coordTest = afwCoord.Coord(afwGeom.Point2D(raArr[ii],
decArr[ii]))
sep = coordTry.angularSeparation(coordTest).asArcseconds()
coordTest = afwGeom.SpherePoint(raArr[ii], decArr[ii], afwGeom.degrees)
sep = coordTry.separation(coordTest).asArcseconds()
if sep <= minSep:
sepGood = False
break
Expand Down
3 changes: 1 addition & 2 deletions python/lsst/synpipe/matchFakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ def getAstroTable(src, mags=True):
data=src.get(nameKey)))
except lsst.pex.exceptions.LsstException:
quadrupole = lsst.afw.geom.ellipses.ellipsesLib.Quadrupole
icrscoord = lsst.afw.coord.coordLib.IcrsCoord
if type(src[0].get(nameKey)) is quadrupole:
"""Check for shape measurements"""
reff, q, theta = list(zip(*[getEllipse(s.get(nameKey))
Expand All @@ -420,7 +419,7 @@ def getAstroTable(src, mags=True):
data=q))
tab.add_column(astropy.table.Column(name=name+'_theta',
data=theta))
elif type(src[0].get(nameKey)) is icrscoord:
elif type(src[0].get(nameKey)) is lsst.afw.geom.SpherePoint:
"""Check for coordinate measurements"""
x, y = list(zip(*[(s.get(nameKey).getRa().asDegrees(),
s.get(nameKey).getDec().asDegrees())
Expand Down
4 changes: 1 addition & 3 deletions python/lsst/synpipe/positionGalSimFakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import lsst.afw.geom
import lsst.afw.math
import lsst.afw.cameraGeom
import lsst.afw.coord
import lsst.pex.config as lsstConfig

from lsst.pipe.tasks.fakes import BaseFakeSourcesConfig, BaseFakeSourcesTask
Expand Down Expand Up @@ -100,8 +99,7 @@ def run(self, exposure, background):
raise KeyError("No mag column in %s" % self.config.galList)

try:
coordAdd = lsst.afw.geom.Point2D(gal['RA'], gal['DEC'])
galCoord = lsst.afw.coord.Coord(coordAdd)
galCoord = lsst.afw.geom.SpherePoint(gal['RA'], gal['DEC'], lsst.afw.geom.degrees)
except KeyError:
raise KeyError("No RA/DEC column in {} table".format(self.config.galList))

Expand Down
4 changes: 1 addition & 3 deletions python/lsst/synpipe/positionStarFakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import lsst.afw.geom as afwGeom
import lsst.afw.math as afwMath
import lsst.afw.coord as afwCoord
import lsst.afw.image as afwImage
import lsst.pex.config as afwConfig

Expand Down Expand Up @@ -63,8 +62,7 @@ def run(self, exposure, background):
raise KeyError("No mag column in %s" % self.config.starList)

try:
starCoord = afwCoord.Coord(afwGeom.Point2D(star['RA'],
star['DEC']))
starCoord = afwGeom.SpherePoint(star['RA'], star['DEC'], afwGeom.degrees)
except KeyError:
raise KeyError("No RA/DEC column in table".format(self.config.starList))

Expand Down