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

Generated noise TOD has wrong PSD #68

Closed
tskisner opened this issue Nov 3, 2016 · 2 comments
Closed

Generated noise TOD has wrong PSD #68

tskisner opened this issue Nov 3, 2016 · 2 comments
Assignees
Labels

Comments

@tskisner
Copy link
Member

tskisner commented Nov 3, 2016

It pains me to open this issue, but it looks like there is a problem with a few lines of code which results in generated noise timestreams having the incorrect PSD. The problem is that the Fourier domain vector that is input to scipy.fft.irfft expects complex values packed as pairs of real and imaginary values, and we have instead been passing in data in the half-complex fftw storage ordering. The result is that the PSD amplitude is applied in the Fourier domain to the wrong elements, resulting in some low frequency power being shifted to higher frequency. This failure mode actually still allows our unit tests (based on overall normalization) to pass.

This was discovered when looking at pull request #67 in more detail. That pull request fixes the issue as a side effect of switching the numpy fft package.

I'm working to fix this now, but wanted to open this issue for the sake of transparency.

@tskisner tskisner added the bug label Nov 3, 2016
@tskisner tskisner self-assigned this Nov 3, 2016
@tskisner
Copy link
Member Author

tskisner commented Nov 3, 2016

Here is a quick plot showing how the incorrect ordering of Fourier domain elements previously led to some power being shifted from low frequency to high.
noise_issue_68

@tskisner
Copy link
Member Author

tskisner commented Nov 8, 2016

This is closed by bfd6b9b. The PSD estimated from the generated noise TOD now agrees with the input, and unit tests have been added to check this.
out_test_simnoise_binpsd_dist_f2b

@tskisner tskisner closed this as completed Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant