-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix center profile #329
Fix center profile #329
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #329 +/- ##
==========================================
+ Coverage 74.87% 75.18% +0.31%
==========================================
Files 27 27
Lines 3546 3591 +45
==========================================
+ Hits 2655 2700 +45
Misses 891 891 ☔ View full report in Codecov by Sentry. |
@JuanCab -- this is actually ready for a look now |
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.
Looks good... but check my comment about the computation of list_from_cen
and make sure that is correct...
# Calculate the distance of each pixel from the center | ||
grid_x, grid_y = np.mgrid[: self._data.shape[0], : self._data.shape[1]] | ||
dist_from_cen = np.sqrt( | ||
(grid_x - self._cen[1]) ** 2 + (grid_y - self._cen[0]) ** 2 |
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 this correct, you have grid_x
determined by : self._data.shape[0]
but you compute the distance from center using (grid_x - self._cen[1])
?
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.
Yeah; this is the array vs image thing.
@@ -72,6 +72,8 @@ def test_find_center_no_star(): | |||
|
|||
|
|||
def test_radial_profile(): | |||
# Test that both curve of growth and radial profile are correct | |||
|
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.
Looks like a reasonable test
def test_radial_profile_with_background(): | ||
# Regression test for #328 -- image with a background level | ||
image = make_gaussian_sources_image(SHAPE, STARS) | ||
image = image + +make_noise_image( |
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.
Superfluous + sign, I think...
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.
Fixed
|
||
|
||
def test_radial_profile_with_background(): | ||
# Regression test for #328 -- image with a background level |
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.
Again, I believe the logic here is sound, though it took a bit for me to understand it.
I fixed the "+" sign and double-checked the |
This fixes #328 by subtracting a rough background in the initial creation of the radial profile. It also fixes #330 by subtracting the background.