Skip to content

Commit

Permalink
Merge branch 'tickets/DM-38667'
Browse files Browse the repository at this point in the history
  • Loading branch information
leeskelvin committed May 19, 2023
2 parents b3a59cf + d2e66a3 commit 58ba891
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions python/lsst/pipe/tasks/processBrightStars.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class ProcessBrightStarsConfig(PipelineTaskConfig, pipelineConnections=ProcessBr
annularFluxRadii = ListField(
dtype=int,
doc="Inner and outer radii of the annulus used to compute AnnularFlux for normalization, in pixels.",
default=(40, 50),
default=(70, 80),
)
annularFluxStatistic = ChoiceField(
dtype=str,
Expand All @@ -154,13 +154,11 @@ class ProcessBrightStarsConfig(PipelineTaskConfig, pipelineConnections=ProcessBr
doc="Mask planes that identify pixels to not include in the computation of the annular flux.",
default=("BAD", "CR", "CROSSTALK", "EDGE", "NO_DATA", "SAT", "SUSPECT", "UNMASKEDNAN"),
)
minPixelsWithinFrame = Field(
dtype=int,
doc=(
"Minimum number of pixels that must fall within the stamp boundary for the bright star to be "
"saved when its center is beyond the exposure boundary."
),
default=50,
minValidAnnulusFraction = Field(
dtype=float,
doc="Minumum number of valid pixels that must fall within the annulus for the bright star to be "
"saved for subsequent generation of a PSF.",
default=0.0,
)
doApplySkyCorr = Field(
dtype=bool,
Expand Down Expand Up @@ -286,10 +284,14 @@ def extractStamps(self, inputExposure, refObjLoader=None):
# select stars within, or close enough to input exposure from refcat
inputIm = inputExposure.maskedImage
inputExpBBox = inputExposure.getBBox()
dilatationExtent = Extent2I(np.array(self.config.stampSize) - self.config.minPixelsWithinFrame)
# Attempt to include stars that are outside of the exposure but their
# stamps overlap with the exposure.
dilatationExtent = Extent2I(np.array(self.config.stampSize) // 2)
# TODO (DM-25894): handle catalog with stars missing from Gaia
withinCalexp = refObjLoader.loadPixelBox(
inputExpBBox.dilatedBy(dilatationExtent), wcs, filterName="phot_g_mean"
inputExpBBox.dilatedBy(dilatationExtent),
wcs,
filterName="phot_g_mean",
)
refCat = withinCalexp.refCat
# keep bright objects
Expand Down Expand Up @@ -501,6 +503,7 @@ def run(self, inputExposure, refObjLoader=None, dataId=None, skyCorr=None):
position=xy0s[j],
gaiaGMag=extractedStamps.GMags[j],
gaiaId=extractedStamps.gaiaIds[j],
minValidAnnulusFraction=self.config.minValidAnnulusFraction,
)
for j, (warp, transform) in enumerate(zip(warpedStars, warpOutputs.warpTransforms))
]
Expand Down

0 comments on commit 58ba891

Please sign in to comment.