Skip to content

Commit

Permalink
use gen_noise_from_psd
Browse files Browse the repository at this point in the history
  • Loading branch information
serfass committed Jan 22, 2025
1 parent b44d0b0 commit 4699541
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def create_example_data(lgcpileup=False, lgcbaseline=False):
pulse_shifted = np.roll(pulse, len(t)//2)
template = pulse_shifted/pulse_shifted.max()

noise = qp.gen_noise(psd_sim, fs=fs, n_traces=1)[0]
noise = qp.gen_noise_from_psd(psd_sim, fs=fs, ntraces=1)[0]
signal = noise + np.roll(template, 100)*(pulse_amp)

if lgcpileup:
Expand Down Expand Up @@ -124,7 +124,7 @@ def create_example_muontail():
pulse = np.exp(-t/tau_fall)
template = pulse/pulse.max()

noise = qp.gen_noise(psd_sim, fs=fs, n_traces=1)[0]
noise = qp.gen_noise_from_psd(psd_sim, fs=fs, ntraces=1)[0]
signal = noise + template * pulse_amp

return signal, psd_sim
Expand Down Expand Up @@ -174,7 +174,7 @@ def create_example_pulseplusmuontail(lgcbaseline=False):
muon_pulse = np.exp(-t/muon_fall)
muon_template = muon_pulse/muon_pulse.max()

noise = qp.gen_noise(psd_sim, fs=fs, n_traces=1)[0]
noise = qp.gen_noise_from_psd(psd_sim, fs=fs, ntraces=1)[0]
signal = noise + template*PULSE_AMP + muon_template*muon_amp

if lgcbaseline:
Expand Down Expand Up @@ -259,7 +259,7 @@ def create_example_ttl_leakage_pulses(
backgroundpulses = backgroundtemplates@bkgamps
backgroundpulses = backgroundpulses * bkgampscale

noise = qp.gen_noise(psd_sim, fs=fs, n_traces=1)[0]
noise = qp.gen_noise_from_psd(psd_sim, fs=fs, ntraces=1)[0]
signal = noise + backgroundpulses + leakagepulse

if lgcbaseline:
Expand Down
2 changes: 1 addition & 1 deletion test/test_didv.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _initialize_didv(poles, sgfreq=100, autoresample=False):
}

psd_test = np.ones(int(4 * fs / sgfreq)) / tracegain**2 / 1e4
rawnoise = qp.gen_noise(psd_test, fs=fs, n_traces=300)
rawnoise = qp.gen_noise_from_psd(psd_test, fs=fs, ntraces=300)

t = np.arange(rawnoise.shape[-1]) / fs
didv_response = qp.squarewaveresponse(
Expand Down

0 comments on commit 4699541

Please sign in to comment.