adjusting scale factor

This commit is contained in:
Sakimori 2025-08-08 11:13:29 -04:00
parent a1af3848cc
commit 8752e51946
No known key found for this signature in database

View file

@ -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