Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions python/lsst/meas/algorithms/loadReferenceObjects.py
Copy link
Member

Choose a reason for hiding this comment

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

Commit message is missing a word near "sky positions the reference catalog".

Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def _filterFunction(refCat, region):
return filteredRefCat
return self.loadRegion(outerSkyRegion, filterName, filtFunc=_filterFunction, epoch=epoch)

def loadRegion(self, region, filterName, filtFunc=None, epoch=None):
def loadRegion(self, region, filterName, filtFunc=None, epoch=None, wcsForCentroids=None):
"""Load reference objects within a specified region.

This function loads the DataIds used to construct an instance of this
Expand Down Expand Up @@ -651,6 +651,9 @@ class which intersect or are contained within the specified region. The
epoch : `astropy.time.Time` or `None`, optional
Epoch to which to correct proper motion and parallax, or `None` to
not apply such corrections.
wcsForCentroids : `lsst.afw.geom.SkyWcs`, optional
If provided, this WCS will be used to convert the reference catalog
sky coordinates to pixel positions.

Returns
-------
Expand Down Expand Up @@ -747,9 +750,20 @@ class which intersect or are contained within the specified region. The

self.applyProperMotions(refCat, epoch)

expandedCat = self._remapReferenceCatalogSchema(refCat,
anyFilterMapsToThis=self.config.anyFilterMapsToThis,
filterMap=self.config.filterMap)
if wcsForCentroids is not None:
expandedCat = self._remapReferenceCatalogSchema(
refCat,
anyFilterMapsToThis=self.config.anyFilterMapsToThis,
filterMap=self.config.filterMap,
centroids=True,
)
afwTable.updateRefCentroids(wcsForCentroids, expandedCat)
else:
expandedCat = self._remapReferenceCatalogSchema(
refCat,
anyFilterMapsToThis=self.config.anyFilterMapsToThis,
filterMap=self.config.filterMap,
)

# Ensure that the returned reference catalog is continuous in memory
if not expandedCat.isContiguous():
Expand Down