Skip to content

DM-36403: Add utility function for summing footprint fluxes#21

Merged
fred3m merged 7 commits intomainfrom
tickets/DM-36403
Jun 22, 2023
Merged

DM-36403: Add utility function for summing footprint fluxes#21
fred3m merged 7 commits intomainfrom
tickets/DM-36403

Conversation

@mfisherlevine
Copy link
Copy Markdown
Contributor

No description provided.

@mfisherlevine mfisherlevine marked this pull request as draft October 4, 2022 01:12
@mfisherlevine mfisherlevine marked this pull request as ready for review October 4, 2022 01:47
Copy link
Copy Markdown

@parejkoj parejkoj left a 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?


def test_fluxFromFootprint(self):
footPrintSet = detectObjectsInExp(self.exp)
allFootprints = footPrintSet.getFootprints()
Copy link
Copy Markdown

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.

@mfisherlevine mfisherlevine force-pushed the tickets/DM-36403 branch 2 times, most recently from 4bba683 to 7ff741c Compare October 25, 2022 16:55
@mfisherlevine mfisherlevine force-pushed the tickets/DM-36403 branch 2 times, most recently from 4e52d9b to c6fe637 Compare November 9, 2022 01:49
@fred3m fred3m force-pushed the tickets/DM-36403 branch from 458c948 to 48c63ff Compare June 1, 2023 15:28
Copy link
Copy Markdown

@parejkoj parejkoj left a 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.
Copy link
Copy Markdown

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?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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.



class ImageBasedTestCase(lsst.utils.tests.TestCase):
"""A test case for testing sky position offsets for exposures."""
Copy link
Copy Markdown

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?

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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.

@fred3m fred3m force-pushed the tickets/DM-36403 branch from 48c63ff to 856f445 Compare June 7, 2023 15:19
@fred3m fred3m merged commit 7fc05bd into main Jun 22, 2023
@fred3m fred3m deleted the tickets/DM-36403 branch June 22, 2023 16:56
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.

3 participants