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

make sure FD white_noise has the same length as asd #4878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pycbc/noise/reproduceable.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ def colored_noise(psd, start_time, end_time,
end_time + filter_duration,
seed=seed,
sample_rate=sample_rate)
# make sure FD white_noise has the same length as asd
white_noise = white_noise.to_frequencyseries()
white_noise.resize(len(asd))
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this is exactly what we want to do here. Maybe the fix should be in the function just above. We definitely can't just resize the freuqency-domain object, but that distorts the sample rate (perhaps only slightly if the vector is long, but still not quite right).

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the problem this is trying to solve. This function takes start_time, end_time and sample_rate, which completely specifies the noise (and so we shouldn't do this).

But if this is a problem, it implies an issue above, as we do do a psd.resize previously to make things match.

Can you give an example of a failure?

# Here we color. Do not want to duplicate memory here though so use '*='
white_noise *= asd*scale
del asd
Expand Down
Loading