Skip to content

Commit

Permalink
This solution to avoid having len(delta_s) = len(forest) is less time…
Browse files Browse the repository at this point in the history
… consuming
  • Loading branch information
Thomas committed Jun 6, 2020
1 parent 0fd69ce commit 92f5925
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/merge_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ def main():
mmm = np.where((wav_rf<constant.lya) & (wav_rf>constant.lylimit))[0]
if len(mmm) > 0:
nz = 256
while (nz < len(wav_tmp)) : nz *= 2
nz *= 2 # make sure that the size of delta_s is larger than the size of the forest, to avoid spurious correlations
while (nz < len(wav_tmp)+10) : nz *= 2 # +10 is to avoid correlations from edge to edge of the forest
delta_s = np.random.normal(size=nz) # latter, produce directly in k space
delta_sk = fft.rfftn(delta_s, threads=ncpu)
k = np.fft.rfftfreq(nz) * 2 * k_ny
Expand Down

0 comments on commit 92f5925

Please sign in to comment.