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-27929: refactor meas_extensions_scarlet and skip sky objects #38

Merged
merged 3 commits into from Mar 29, 2021

Conversation

fred3m
Copy link
Contributor

@fred3m fred3m commented Mar 22, 2021

While implementing the code to skip sky sources, the goal of DM-27929, I discovered that inconsistencies in the way that primary sources are handled lead to columns in primary sources not being updated correctly. It has also been quite a while since meas_extensions_scarlet was first created and it needed a face-lift anyway, so this PR refactors meas_extensions_scarlet to do all of the deblending in the input (mergedDet) catalog to make sure that all of the sources have their flags set appropriately, then the band-dependent columns and footprints are set in individual catalogs that are copied from the original.

fred3m added 2 commits March 22, 2021 09:27
While implementing a fix to skip sky objects I noticed that
there are a number of places where columns were not being appropriately
updated. So this commit refactors ScarletDeblendTask to make it less
likely that similar errors can occur in the future, and also adds
tests to check that columns are being persisted properly.

The major change is that now all of the source updates are
occurring on the input (mergeDet) catalog, and only at the end
are the single band catalogs created and updated with band specific
information. An added benefit is that deblended sources have the
same source ID across catalogs, and are also now continuous catalogs.
This task was missing tests to ensure that the appropriate
output columns were being generated, and that their values
are correct. So this commit adds some much needed testing.
Copy link

@taranu taranu left a comment

Choose a reason for hiding this comment

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

Minor fixes/optional suggestions.

python/lsst/meas/extensions/scarlet/scarletDeblendTask.py Outdated Show resolved Hide resolved
python/lsst/meas/extensions/scarlet/scarletDeblendTask.py Outdated Show resolved Hide resolved
python/lsst/meas/extensions/scarlet/scarletDeblendTask.py Outdated Show resolved Hide resolved
python/lsst/meas/extensions/scarlet/scarletDeblendTask.py Outdated Show resolved Hide resolved
python/lsst/meas/extensions/scarlet/scarletDeblendTask.py Outdated Show resolved Hide resolved
# Set the psf key based on whether or not the source was
# deblended using the PointSource model.
# This key is not that useful anymore since we now keep track of
# `modelType`, but we continue to propagate it in case code downstream
# is expecting it.
src.set(self.psfKey, scarletSource.__class__.__name__ == "PointSource")
src.set(self.modelTypeKey, scarletSource.__class__.__name__)
# We set the runtime to zero so that summing up the
Copy link

Choose a reason for hiding this comment

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

Set the runtime to zero as opposed to what? If you're zeroing out some overhead time, is there a way to add that up separately?

tests/test_deblend.py Outdated Show resolved Hide resolved
tests/test_deblend.py Show resolved Hide resolved
tests/test_deblend.py Outdated Show resolved Hide resolved
@fred3m fred3m merged commit ec40618 into master Mar 29, 2021
@fred3m fred3m deleted the tickets/DM-27929 branch March 29, 2021 20: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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants