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

Set random seeds for fake noise in make_skymap example #4883

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

titodalcanton
Copy link
Contributor

This modifies one of the examples of pycbc_make_skymap to make it clear that random seeds for fake noise must be set explicitly.

Standard information about the request

This is a documentation enhancement.

This change affects one of the examples of pycbc_make_skymap.

Motivation

When simulating noise on multiple detectors via --fake-strain, it is important to set different random seeds in different detectors, otherwise you will get the same noise realization in all detectors, which is usually not how you want to simulate noise!

The example of pycbc_make_skymap that uses simulated noise was not setting the seed explicitly, therefore implicitly using the same seed for all detectors. The resulting skymap looks correct visually, but this can lead to weird results when doing large simulations and checking the results statistically.

Contents

In light of the issue described above, this PR adds explicit seeds to the example.

Links to any issues or associated PRs

N/A

Testing performed

Ran the example before and after this change and plotted the resulting SNR timeseries. Before, I get this:

image

After, I get this:

image

Note the pattern of the noise fluctuations away from the central SNR peaks.

Additional notes

Thanks to Nicolas and Clara for noticing this.

  • The author of this pull request confirms they will adhere to the code of conduct

Copy link
Contributor

@spxiwh spxiwh left a comment

Choose a reason for hiding this comment

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

... I wonder if we could seed the data based on the provided random seed and the ifo in some way? This would avoid the default being the same data for all ifos ... Or just randomly choosing a seed if one wasn't explicitly given.

@spxiwh spxiwh merged commit 613baf8 into gwastro:master Sep 25, 2024
30 checks passed
@titodalcanton titodalcanton deleted the make-skymap-fake-strain-seed branch September 26, 2024 08:25
@titodalcanton
Copy link
Contributor Author

@spxiwh I imagine there is a way to do that, and it sounds like a very good idea, but I would have to dig a bit into the current code to find out.

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