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

Fix issue with frequency_sp being ignored #219

Merged
merged 2 commits into from
Mar 21, 2024
Merged

Conversation

darafferty
Copy link
Collaborator

This PR fixes an issue described in #218, where the value of the frequency_sp option was ignored during the collapse of the image channels.

@darafferty darafferty requested a review from gmloose March 20, 2024 13:37
@darafferty darafferty self-assigned this Mar 20, 2024
Copy link
Collaborator

@gmloose gmloose left a comment

Choose a reason for hiding this comment

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

I lack detailed knowledge of the inner workings of PyBDSF, so I have to trust you on the logic you added.

bdsf/collapse.py Outdated
# others have weight of 0. The init_freq_collapse function will then
# select the intended frequency
c_list = img.opts.collapse_av
if c_list == []:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer to write this as: if not c_list:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good suggestion. In fact, I see now that much of the new code I added is redundant, as many of the same things are done a bit earlier. So I removed some of the new stuff and refactored the existing code a bit.

bdsf/collapse.py Show resolved Hide resolved
@gmloose
Copy link
Collaborator

gmloose commented Mar 21, 2024

LGTM.

@darafferty darafferty merged commit 94ad55a into master Mar 21, 2024
2 checks passed
@darafferty darafferty deleted the fix_frequency_sp_option branch March 21, 2024 11:19
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.

2 participants