From 8752e519463c3682062ab575da2286eb06164752 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Fri, 8 Aug 2025 11:13:29 -0400 Subject: [PATCH] adjusting scale factor --- signalgen.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/signalgen.py b/signalgen.py index 65195fa..0ed567b 100755 --- a/signalgen.py +++ b/signalgen.py @@ -31,6 +31,8 @@ LOG_MIN_WIDTH = 0 LOG_MAX_WIDTH = 3 #in ms MAX_BURSTS = 4 LOG_FIDUCIAL_WIDTH = -2.6 +SCALE_SLOPE = 0.2 +SCALE_OFFSET = 1 rng = np.random.default_rng() #This function from https://josephwkania.github.io/will/examples/inject_pulse.html#Show-how-we-can-inject-a-pulse-into-a-GREENBURST-filterbank. @@ -171,7 +173,7 @@ def addBurst(values): ) #We need to scale the number of samples with pulse width to (hopefully) maintain constant peak flux - scaleFac = (pWidth/(10**(LOG_FIDUCIAL_WIDTH))) + scaleFac = ((pWidth/(10**(LOG_FIDUCIAL_WIDTH)))*SCALE_SLOPE) + SCALE_OFFSET scaledSamps = int(values.nsamp * scaleFac) logger.info(f"Sampling pulse # {run+1} with width {round(pWidth,3)} s {scaledSamps} times.") pulse = pulseObj.sample_pulse(nsamp=scaledSamps) #30000 by default