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

Add detrend function #188

Merged
merged 4 commits into from
Jan 17, 2025
Merged

Add detrend function #188

merged 4 commits into from
Jan 17, 2025

Conversation

mmccrackan
Copy link
Contributor

This branch adds a detrend function that duplicates the functionality in sotodlib's detrend_tod function for 1D or 2D arrays (sotodlib supports higher dimensions, but I haven't reproduced that here for now). It has mean, median (using GSL median which is much faster than a std::sort approach), and linear detrending along the rows of an array.

This is primarily intended to be used in an upcoming Welch PSD function but is also standalone, so the underlying function can be run sequentially and called within a parallel loop inside another function (more efficient for the Welch PSD calculation).

@mmccrackan mmccrackan requested a review from mhasself October 22, 2024 17:23
mhasself
mhasself previously approved these changes Jan 14, 2025
Copy link
Member

@mhasself mhasself left a comment

Choose a reason for hiding this comment

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

Sorry this fell off my radar... looks good.

Approving but please fix the docstring.

Please squash on merge.

src/array_ops.cxx Outdated Show resolved Hide resolved
@mmccrackan mmccrackan requested a review from mhasself January 16, 2025 20:56
@mmccrackan mmccrackan merged commit 3419cc6 into master Jan 17, 2025
4 checks passed
@mmccrackan mmccrackan deleted the detrend branch January 17, 2025 18:27
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