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-27843: Add anyFilterMapsToThis support to ReferenceObjectLoader #274

Merged
merged 6 commits into from Dec 30, 2021

Conversation

parejkoj
Copy link
Contributor

As part of getting the gen3 code to support the more complicated filter mapping logic that the gen2 code did, I also refactored several methods into the common base class. Gen2 is going away soon, but we also want to keep as much of the gen2 test coverage as we can: this should help with that.

@parejkoj parejkoj force-pushed the tickets/DM-27843 branch 2 times, most recently from 7c4b838 to 5c88bc0 Compare December 28, 2021 21:11
Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

I reviewed commit-by-commit, and some code moved around, so it's possible the locations some changes should be made have moved. But all comments are minor, and (I think) entirely about docs.

Overall, looks like a very nice cleanup. I think this doesn't actually touch the logic used to do the padding when actually loading refcat rows in regions, which is good - that code is super fragile and not particularly well tested in CI, IIRC, and there are subtle differences between how Gen2 and Gen3 work that I think are important. Someday we should try to fix that, of course, but for now I just want to make sure we avoid letting that problem torpedo unrelated "nearby" tickets like this one.

python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
python/lsst/meas/algorithms/loadReferenceObjects.py Outdated Show resolved Hide resolved
This is the new base class that all gen2/gen3 loaders derive from, so
we should use it in tests of loaders. This will let us move more
methods into this base class.
* Use getMetadataCircle in getMetadataBox base method, but include the
box corners additions to it from the gen3 code.
* Move parameter docs for gen3 loader out of __init__.
* Make _calculateCircle a static method, as it only needs pixelMargin.
* Move makeMinimalSchema from gen2 base class, as we need it for making
new catalogs no matter what.
* Use ReferenceObjectLoaderBase in places that call static methods.
s joinMatchListWithCatalog was identical between gen2 and gen3.
* Unify the flux field remapping and centroid adding, so we only need to call
the _remap method, not both.
* We only need to call this once per refcat load (gen3 loader was potentially
calling it multiple times).
* Use the new _remap method in gen2 LoadIndexedReferenceObjectsTask.
This is never called in the same context as the gen2 version, so we can
remove it as it has been deprecated for years.
The only places that passed this arg were in meas_astrom, and I'm taking care
of them on this ticket.
@parejkoj parejkoj merged commit be01a45 into main Dec 30, 2021
@parejkoj parejkoj deleted the tickets/DM-27843 branch December 30, 2021 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants