scale nsamp with pulse width

This commit is contained in:
Sakimori 2025-08-07 12:29:08 -04:00
parent b09a1a9fbb
commit b736d3c892
No known key found for this signature in database

View file

@ -30,6 +30,7 @@ LOG_MAX_DM = 3.5
LOG_MIN_WIDTH = 0
LOG_MAX_WIDTH = 3 #in ms
MAX_BURSTS = 4
LOG_FIDUCIAL_WIDTH = -2.6
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.
@ -168,7 +169,11 @@ def addBurst(values):
nscint=0,
bandpass = bpWeights
)
pulse = pulseObj.sample_pulse(nsamp=values.nsamp) #30000 by default
#We need to scale the number of samples with pulse width to (hopefully) maintain constant peak flux
scaleFac = (pWidth/(10**(LOG_FIDUCIAL_WIDTH)))
scaledSamps = values.nsamp * scaleFac
pulse = pulseObj.sample_pulse(nsamp=scaledSamps) #30000 by default
logger.info("Injecting pulse and saving file.")
#inject pulse