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-5532 #22
DM-5532 #22
Conversation
Preparation for adding StarSelectorTask to the starSelector module
d1285be
to
4fa2475
Compare
psfCandidateList.append(psfCandidate) | ||
goodStarCat.append(star) | ||
except Exception as err: | ||
self.log.warn("Failed to make a psfCandidate from star %d: %s" % (star.getId(), err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to just wrap the call to makePsfCandidate
in a try block, as I don't think we expect it to be possible that the rest could throw (and hence we'd want the exception to propagate up and cause an early failure if it did, so we could fix the bug).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent idea.
Can one of the admins verify this patch? |
|
||
starSelectorRegistry.register("objectSize", ObjectSizeStarSelector) | ||
starCat = SourceCatalog(sourceCat.schema) | ||
for isStellar, source in zip(stellar, [s for g, s in zip(good, sourceCat) if g]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic in this loop argument is complex enough that it probably merits a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion the code is confusing and needs a cleanup pass. However, I will break this one line into two (make the list, then use it). It is still not obvious to me why stellar
and good
have the same length (e.g. from reading the code above).
Remove python wrapper from SizeMagnitudeStarSelector and remove this star selector from the registry, because the sizeMagnitude star selector has bit-rotted and will be removed.
Instead of registering a few select star selectors in the star selector registry module, make each star selector register itself. This improves uniformity, avoids giving the impression that certain selectors are preferable and makes it easier to decommission obsolete star selectors.
c4913e2
to
9ce2f3f
Compare
Add StarSelectorTask as a base class for star selectors; this introduces a new API as per RFC-154: - selectStars returns a struct containing a catalog of stars instead of a list of PSF candidates - makePsfCandidates makes candidates from a catalog of stars - run calls selectStars and optionally sets a flag field
Modify the existing star selectors ObjectSizeStarSelector and SecondMomentStarSelector to subclass StarSelectorTask and append Task to their name. Update the API by making the selectStars method return a catalog of stars instead of a list of PSF candidates. Update the unit tests accordingly.
For the star selectors, when only one or two symbols are used from a package import the symbols instead of the whole package to reduce use of abbreviated namespaces.
Registries don't construct classes with enough information to do a good job on subtasks, so don't use a registry for star selectors.
There were two debug parameters in SecondMomentStarSelector that did the same thing: display and displayExposure. Both had to be set True to display anhything. I ditched the latter.
Add full task documentation for ObjectSizeStarSelectorTask and SecondMomentStarSelectorTask
Modify StarSelector.run to make PSF candidates. The returned star catalog (and sources flagged as stars) excludes stars that could not be made into PSF candidates.
Remove trailing whitespace Remove trailing semicolons Split expressions into separate lines
No description provided.