Skip to content

Commit

Permalink
Use RA/Dec config column names
Browse files Browse the repository at this point in the history
  • Loading branch information
mrawls committed Feb 7, 2022
1 parent 141fb8f commit 885b67b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python/lsst/pipe/tasks/insertFakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,8 @@ def trimFakeCat(self, fakeCat, image):
points.extend(wcs.pixelToSky(corner).getVector() for corner in wideBbox.getCorners())
polygon = ConvexPolygon(points)

ras = fakeCat["raJ2000"].values
decs = fakeCat["decJ2000"].values
ras = fakeCat[self.config.ra_col].values
decs = fakeCat[self.config.dec_col].values

isContainedRaDec = polygon.contains(ras, decs)

Expand Down
9 changes: 5 additions & 4 deletions python/lsst/pipe/tasks/matchFakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def composeFakeCat(self, fakeCats, skyMap):
def _addPixCoords(self, fakeCat, image):

"""Add pixel coordinates to the catalog of fakes.
Parameters
----------
fakeCat : `pandas.core.frame.DataFrame`
Expand All @@ -233,8 +234,8 @@ def _addPixCoords(self, fakeCat, image):
fakeCat : `pandas.core.frame.DataFrame`
"""
wcs = image.getWcs()
ras = fakeCat['ra'].values
decs = fakeCat['dec'].values
ras = fakeCat[self.config.ra_col].values
decs = fakeCat[self.config.dec_col].values
xs, ys = wcs.skyToPixelArray(ras, decs)
fakeCat["x"] = xs
fakeCat["y"] = ys
Expand Down Expand Up @@ -270,8 +271,8 @@ def _trimFakeCat(self, fakeCat, image):
points.extend(wcs.pixelToSky(corner).getVector() for corner in wideBbox.getCorners())
polygon = ConvexPolygon(points)

ras = fakeCat["raJ2000"].values
decs = fakeCat["decJ2000"].values
ras = fakeCat[self.config.ra_col].values
decs = fakeCat[self.config.dec_col].values
isContainedRaDec = polygon.contains(ras, decs)

# now use the exact pixel BBox to filter to only fakes that were inserted
Expand Down

0 comments on commit 885b67b

Please sign in to comment.