-
Notifications
You must be signed in to change notification settings - Fork 177
JP-3810 followup: small clean-up tasks in AMI module #9441
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
Conversation
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.
The problem was that the argmax
call on dft_offset
is multi-valued if offset is an integer. Prior to these changes, there were 4 pixels with equal value. It seems that numpy 2 picks a different one of those 4 pixels to use than numpy 1, which led to this error. The test was fixed by simply using an offset that does not contain integer values. There was nothing wrong with the matrix DFT code itself, the test was just badly written.
Related to the sonarscan PR: is there any worry that the psf_offset is implemented in the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9441 +/- ##
==========================================
+ Coverage 77.86% 77.90% +0.03%
==========================================
Files 362 362
Lines 36335 36340 +5
==========================================
+ Hits 28294 28310 +16
+ Misses 8041 8030 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@tapastro Thanks for bringing this up. I'm having a side-conversation with @rcooper295 and @anand0xff that may make this irrelevant - they might want to just remove the option to provide an offset at all |
The But this leaves a few questions here for @rcooper295 or @anand0xff:
|
I think it should; unless there's something I'm missing I don't see why the circular case shouldn't support an offset the way the hex case does. Though currently I'm getting the error that
I think that should be fine; I see that it previously failed since asfd wasn't defined in that case. The "psf" produced with that change looks reasonable to me.
I don't think we should remove the @anand0xff does this seem ok? |
Thanks very much for these responses. I will fix the "circ" and "circonly" cases and see if they look reasonable... the expectation that it yields an Airy ring because it's just the Fourier transform of the circular aperture, is that correct?
This was related to the same conversation we were having before about offsets in the matrix DFT. From my reading of the code, these two offsets are related, i.e. if we wanted to drop support for a user-specified |
ok @rcooper295 the
Please let me know how you'd like to see this changed. Are the "circ" and "circonly" options even necessary to continue supporting? |
@emolter I see what you mean about the "circ" and "circonly" cases being at 0,0 rather than the center of the array, and the offset not having an effect when passed directly to jinc(). But by passing psf_offset to asf() and calculating im_ctr and using that as the offx and offy inputs to jinc(), it seems to do what I'd expect. Locally my asf() function now reads:
Passing the offset to both asf() and asf_fringe() in the "circ" case also seems to work ok (places the fringes and the primary beam at the same offset). |
Thanks very much @rcooper295 , with your suggested changes the output makes sense to me, too. Going to run our testing suite and then mark this ready for review soon. Would you mind giving it a quick look-over to see if the changes here make sense to you? |
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.
These changes to clean up and fix some of the accessory functions for AMI modeling look good to me.
Follow-up of JP-3810
Closes #9437
This PR addresses a few small follow-up items from the larger AMI clean-up PR:
hextransformee
, replacing it with a comment explaining that the behavior in question is intendedmatrix_dft
analyticnrm2.psf
erroring outTasks
Build 12.0
(use the latest build if not sure)no-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see changelog readme for instructions)docs/
pageokify_regtests
to update the truth files