Skip to content

Commit

Permalink
Merge pull request #460 from lsst/tickets/DM-28552
Browse files Browse the repository at this point in the history
DM-28552: Make warping optional
  • Loading branch information
MorganSchmitz committed Feb 8, 2021
2 parents 5ddf180 + 2977649 commit 778a6a5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions python/lsst/pipe/tasks/processBrightStars.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ class ProcessBrightStarsConfig(pipeBase.PipelineTaskConfig,
"BAD",
default=True
)
doApplyTransform = pexConfig.Field(
dtype=bool,
doc="Apply transform to bright star stamps to correct for optical distortions?",
default=True
)
warpingKernelName = pexConfig.ChoiceField(
dtype=str,
doc="Warping kernel",
Expand Down Expand Up @@ -286,7 +291,10 @@ def warpStamps(self, stamps, pixCenters):
# exposure from the same detector)
det = stamps[0].getDetector()
# Define correction for optical distortions
pixToTan = det.getTransform(cg.PIXELS, cg.TAN_PIXELS)
if self.config.doApplyTransform:
pixToTan = det.getTransform(cg.PIXELS, cg.TAN_PIXELS)
else:
pixToTan = tFactory.makeIdentityTransform()
# Array of all possible rotations for detector orientation:
possibleRots = np.array([k*np.pi/2 for k in range(4)])
# determine how many, if any, rotations are required
Expand Down Expand Up @@ -360,7 +368,7 @@ def run(self, inputExposure, refObjLoader=None, dataId=None):
# Extract stamps around bright stars
extractedStamps = self.extractStamps(inputExposure, refObjLoader=refObjLoader)
# Warp (and shift, and potentially rotate) them
self.log.info("Applying warp to %i star stamps from exposure %s",
self.log.info("Applying warp and/or shift to %i star stamps from exposure %s",
len(extractedStamps.starIms), dataId)
warpedStars = self.warpStamps(extractedStamps.starIms, extractedStamps.pixCenters)
brightStarList = [bSS.BrightStarStamp(stamp_im=warp,
Expand Down

0 comments on commit 778a6a5

Please sign in to comment.