CWSimulator.write_sft_files does not generate random SFTs by default
Description of problem
When using CWSimulator.write_sft_files() to generate random Gaussian noise or injections in Gaussian noise, by default, different trials do not produce random noise.
The parameter "noise_seed" is set to 0 by default. If we input random seeds into that noise_seed, the output SFTs from different trials become random. But if we keep noise_seed=0, the output SFTs are almost identical; "almost identical" means that the first SFT in a sequence is random, but starting from the second one and onwards, the SFTs are identical from multiple trials, i.e., SFT(0)_trial0 != SFT(0)_trial1, but SFT(n)_trial0 = SFT(n)_trial1 when n>0.
Expected behavior
By default, the Gaussian noise generated should be random. If we run 100 trials, that should represent random Gaussian noise.
Steps to reproduce
Some dummy code here:
S = CWSimulator ( tref=args.tref,
tstart=args.t0,
Tdata=args.T,
waveform=wf,
dt_wf=args.dtwf,
phi0=args.phi0,
psi=args.psi,
alpha=args.ra,
delta=args.dec,
det_name=detector,
tref_at_det=True,
extra_comment = cmdline
)
S.write_sft_files ( fmax=args.sft_fmax,
Tsft=args.sft_T,
comment="simulation",
noise_sqrt_Sh=args.noise_sqrt_Sh,
out_dir=sft_out_dir,
window=args.sft_window,
window_param=args.sft_window_param
)
Problem can be solved by adding noise_seed=random.randint(0,100000) to S.write_sft_files()
Context/environment
This was found when running simulations for short-duration vector boson signals on CIT clusters (also on personal laptop). The same issue exists for whatever simulations done in Gaussian noise.