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

Modified counter 1 over f filter to accept array-like input #936

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tterasaki
Copy link
Contributor

I want to apply counter 1 over f filter with each detector's filter value.

@tterasaki tterasaki requested review from mhasself and msilvafe August 26, 2024 12:38
@mhasself
Copy link
Member

Sounds good -- can you take this opportunity to improve the docstring, and to add this filter to the tests (in both modes)?

Also I believe this will work for both scalar and array arguments:

fk = np.array(fk)[..., None]
n = np.array(n)[..., None]
return 1 / (1 + (fk/freqs)**n)

but perhaps that's not so transparent.

@msilvafe
Copy link
Contributor

Sounds good -- can you take this opportunity to improve the docstring, and to add this filter to the tests (in both modes)?

Also I believe this will work for both scalar and array arguments:

fk = np.array(fk)[..., None]
n = np.array(n)[..., None]
return 1 / (1 + (fk/freqs)**n)

but perhaps that's not so transparent.

Also if you want to split out the array input vs scalar input you can just check np.isscalar(fk) and then if its not an int or float you'll get a type error which is ok.

@mhasself
Copy link
Member

mhasself commented Sep 9, 2024

@tterasaki Please let me know if you will be (a) fixing the docs and (b) adding to tests. If not, I will make those changes.

@msilvafe msilvafe changed the title modfified conter 1 over f filter to accept array-like input Modified counter 1 over f filter to accept array-like input Nov 13, 2024
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