From ce56ad385ca3316f779ef2d488313550a32851a4 Mon Sep 17 00:00:00 2001 From: William Lamb <60004701+astrolamb@users.noreply.github.com> Date: Fri, 13 Feb 2026 16:54:09 -0600 Subject: [PATCH] Fixed - Tspan is given as an option, but its value is hardcoded in the function. --- pta_replicator/red_noise.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pta_replicator/red_noise.py b/pta_replicator/red_noise.py index 100ebdd..f109e24 100644 --- a/pta_replicator/red_noise.py +++ b/pta_replicator/red_noise.py @@ -121,7 +121,10 @@ def add_red_noise(psr: SimulatedPulsar, log10_amplitude: float, spectral_index: print('Must use linear spacing.') toas = np.array(psr.toas.table['tdbld'], dtype='float64') * DAY_IN_SEC #to sec - Tspan = toas.max() - toas.min() + + if Tspan is None: + Tspan = toas.max() - toas.min() + F, freqs = create_fourier_design_matrix_red(toas, Tspan=Tspan, nmodes=components, modes=modes, libstempo_convention=libstempo_convention) prior = A**2 * (freqs/fyr)**(-gamma) / (12 * np.pi**2 * Tspan) * YEAR_IN_SEC**3 y = np.sqrt(prior) * np.random.randn(freqs.size)