Set random seeds for fake noise in make_skymap example #4883
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
After, I get this:
Note the pattern of the noise fluctuations away from the central SNR peaks.
Additional notes
Thanks to Nicolas and Clara for noticing this.