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-39796: Update task config defaults to LSST values #185

Merged
merged 3 commits into from
Sep 21, 2023
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
2 changes: 1 addition & 1 deletion include/lsst/meas/astrom/matchOptimisticB.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct MatchOptimisticBControl {
MatchOptimisticBControl()
: refFluxField("r_flux"),
sourceFluxField("slot_ApFlux_instFlux"),
numBrightStars(100),
numBrightStars(150),
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting all the numBrightStars defaults to 150 seems reasonable, as this is roughly in the middle of the various values here and below, and it's the obs_subaru setting, but this is changing the current LSST value. I just want to check that this is what you intend to do.

Copy link
Contributor Author

@parejkoj parejkoj Sep 19, 2023

Choose a reason for hiding this comment

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

Yes, it's unclear why LSST used a different value, and I don't think there's any obvious a priori reason to take the LSST value over the HSC one (which is likely better tested).

minMatchedPairs(50),
matchingAllowancePix(10.0),
maxOffsetPix(300),
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/meas/astrom/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class AstrometryConfig(RefMatchConfig):
dtype=bool,
doc=("If True then a rough zeropoint will be computed from matched sources "
"and outliers will be rejected in the iterations."),
default=False,
default=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that this now matches the LSST value and that the corresponding config setting has been removed in obs_lsst. However, do you want to add doMagnitudeOutlierRejection=False to obs_subaru, or are you purposely changing the behavior there?

Copy link
Contributor Author

@parejkoj parejkoj Sep 19, 2023

Choose a reason for hiding this comment

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

I have overridden it in obs_subaru, as part of a commit that tries to ensure HSC processing is unchanged after this ticket. It also has a note that HSC/DRP should review those new overrides, as they are likely unnecessary.

)
magnitudeOutlierRejectionNSigma = pexConfig.Field(
dtype=float,
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/meas/astrom/fitTanSipWcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def fitWcs(self, matches, initWcs, bbox=None, refCat=None, sourceCat=None, expos
if rejected.sum() == len(rejected):
raise RuntimeError("All matches rejected in iteration %d" % (rej + 1,))
self.log.debug(
"Iteration %d of astrometry fitting: rejected %f outliers, out of %d total matches.",
"Iteration %d of astrometry fitting: rejected %d outliers, out of %d total matches.",
rej, rejected.sum(), len(rejected)
)
if debug.plot:
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/meas/astrom/matchOptimisticBTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class MatchOptimisticBConfig(pexConfig.Config):
min=0,
)
numBrightStars = pexConfig.RangeField(
doc="Number of bright stars to use",
doc="Maximum number of bright stars to use in fit.",
dtype=int,
default=50,
default=150,
min=2,
)
minMatchedPairs = pexConfig.RangeField(
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/meas/astrom/matchPessimisticB.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ class MatchPessimisticBConfig(pexConfig.Config):
"""Configuration for MatchPessimisticBTask
"""
numBrightStars = pexConfig.RangeField(
doc="Number of bright stars to use. Sets the max number of patterns "
doc="Maximum number of bright stars to use. Sets the max number of patterns "
"that can be tested.",
dtype=int,
default=200,
default=150,
min=2,
)
minMatchedPairs = pexConfig.RangeField(
Expand Down
2 changes: 2 additions & 0 deletions tests/test_astrometryTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def doTest(self, pixelsToTanPixels, order=3):
config = AstrometryTask.ConfigClass()
config.wcsFitter.order = order
config.wcsFitter.numRejIter = 0
# This test is from before rough magnitude rejection was implemented.
config.doMagnitudeOutlierRejection = False
solver = AstrometryTask(config=config, refObjLoader=self.refObjLoader)
results = solver.run(
sourceCat=sourceCat,
Expand Down