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

Template.py: make filter warnings conditional and allow for no ctf_params #98

Merged
merged 8 commits into from
Feb 12, 2024

Conversation

sroet
Copy link
Collaborator

@sroet sroet commented Feb 9, 2024

replaces #88

I got a question from a novice user that thought it was bad when he did not specify the lowpass filter.
This now makes the log message conditional to the input

During the writing of the test I saw that there was code handeling ctf_params=None (line 73), so I added that option as a default to the call as well

@sroet sroet requested a review from McHaillet February 9, 2024 14:53
@McHaillet
Copy link
Collaborator

McHaillet commented Feb 12, 2024

Thanks for the PR to address it!

I was thinking it might be better if there is no warning message if the filter is not set.
Only if its set and too low, it should give a warning that it is reseting to nyquist resolution.
Something like:

if filter_to_resolution is None:
    filter_to_resolution = 2 * output_spacing
elif filter_to_resolution < (2 * output_spacing):
    logging.warning('...')
    filter_to_resolution = 2 * output_spacing

@sroet
Copy link
Collaborator Author

sroet commented Feb 12, 2024

Thanks for the PR to address it!

I was thinking it might be better if there is no warning message if the filter is not set. Only if its set and too low, it should give a warning that it is reseting to nyquist resolution. Something like:

if filter_to_resolution is None:
    filter_to_resolution = 2 * output_spacing
elif filter_to_resolution < (2 * output_spacing):
    logging.warning('...')
    filter_to_resolution = 2 * output_spacing

You are right, was my preferred solution as well 👍 I altered it to that, please have another look

src/pytom_tm/template.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@McHaillet McHaillet left a comment

Choose a reason for hiding this comment

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

LGTM

@sroet sroet merged commit 3f963fc into SBC-Utrecht:main Feb 12, 2024
@sroet sroet deleted the sroet-patch-3 branch February 12, 2024 15:12
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