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-36403: Add utility function for summing footprint fluxes #21
Conversation
0abce60
to
983f5b5
Compare
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.
I think this could reasonably go into afw/detection/utils.py
Any reason why you wouldn't want it here?
tests/test_utils.py
Outdated
|
||
def test_fluxFromFootprint(self): | ||
footPrintSet = detectObjectsInExp(self.exp) | ||
allFootprints = footPrintSet.getFootprints() |
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.
This test doesn't need a butler at all, you could construct the image directly. For example, afw/tests/test_footprint[1,2].py
place objects in an Image and make the footprints in place.
4bba683
to
7ff741c
Compare
4e52d9b
to
c6fe637
Compare
c6fe637
to
dc7af54
Compare
dc7af54
to
0d87de1
Compare
0d87de1
to
d74333b
Compare
d74333b
to
54e891a
Compare
0525d6a
to
458c948
Compare
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.
Handful of comments, most important being that you need to change extract
to compute
when calling the afw function.
Returns | ||
------- | ||
fluxes : `list` of `float` | ||
The fluxes for each footprint. |
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.
Is there any value in returning a numpy array here instead?
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.
I'm happy with a list, personally. If the user needs, it can always be cast with np.asarray
as needed.
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.
I can't see the harm. I'll implement unless @mfisherlevine objects.
tests/test_utils.py
Outdated
@@ -207,6 +213,59 @@ def test_quantiles(self): | |||
np.testing.assert_almost_equal(edges1, edges2, decimal=decimal) | |||
|
|||
|
|||
class ImageBasedTestCase(lsst.utils.tests.TestCase): | |||
"""A test case for testing sky position offsets for exposures.""" |
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.
Are the docstring and/or class name right?
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.
Agree, docstring looks wrong. I'm going to leave fixing these to @fred3m though to save having too many cooks here.
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.
Unless either of you has a suggestion, I'm just going to delete the docstring. Most of the other test classes don't have docstrings, and since it currently only contains one test, I'm not sure what the long intent of this class is.
856f445
to
287fe20
Compare
No description provided.