adjusting scale factor
This commit is contained in:
parent
a1af3848cc
commit
8752e51946
|
@ -31,6 +31,8 @@ LOG_MIN_WIDTH = 0
|
||||||
LOG_MAX_WIDTH = 3 #in ms
|
LOG_MAX_WIDTH = 3 #in ms
|
||||||
MAX_BURSTS = 4
|
MAX_BURSTS = 4
|
||||||
LOG_FIDUCIAL_WIDTH = -2.6
|
LOG_FIDUCIAL_WIDTH = -2.6
|
||||||
|
SCALE_SLOPE = 0.2
|
||||||
|
SCALE_OFFSET = 1
|
||||||
rng = np.random.default_rng()
|
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.
|
#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
|
#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)
|
scaledSamps = int(values.nsamp * scaleFac)
|
||||||
logger.info(f"Sampling pulse # {run+1} with width {round(pWidth,3)} s {scaledSamps} times.")
|
logger.info(f"Sampling pulse # {run+1} with width {round(pWidth,3)} s {scaledSamps} times.")
|
||||||
pulse = pulseObj.sample_pulse(nsamp=scaledSamps) #30000 by default
|
pulse = pulseObj.sample_pulse(nsamp=scaledSamps) #30000 by default
|
||||||
|
|
Loading…
Reference in a new issue