mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-12-22 11:33:32 +01:00
ZH: specify after_N when extending beaconed traces
This commit is contained in:
parent
888d81c1f6
commit
730823f54d
1 changed files with 13 additions and 6 deletions
|
@ -303,21 +303,28 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
# make beacon per antenna
|
# make beacon per antenna
|
||||||
for i, antenna in enumerate(ev.antennas):
|
for i, antenna in enumerate(ev.antennas):
|
||||||
if False: # modify trace lengths
|
if i%10 == 0:
|
||||||
|
print(f"Beaconed antenna {i} out of", len(ev.antennas))
|
||||||
|
|
||||||
|
if not False: # modify trace lengths
|
||||||
N_samples = len(antenna.t)
|
N_samples = len(antenna.t)
|
||||||
new_N = 2*N_samples
|
#new_N = 2*N_samples
|
||||||
new_N = 10000 # ns = 10us
|
new_N = 10000 # ns = 10us
|
||||||
pre_N = 2000 # ns = 2us
|
pre_N = 2000 # ns = 2us
|
||||||
|
after_N = new_N - pre_N
|
||||||
|
|
||||||
dt = antenna.t[1] - antenna.t[0]
|
dt = antenna.t[1] - antenna.t[0]
|
||||||
new_t = np.arange(-pre_N, new_N - pre_N)*dt + antenna.t[0]
|
new_t = np.arange(-pre_N, after_N)*dt + antenna.t[0]
|
||||||
|
|
||||||
antenna.t = new_t
|
antenna.t = new_t
|
||||||
|
|
||||||
# TODO:trace extrapolation?
|
# TODO:trace extrapolation?
|
||||||
antenna.Ex = np.pad(antenna.Ex, (pre_N, new_N-N_samples-pre_N), mode='constant', constant_values=0)
|
antenna.Ex = np.pad(antenna.Ex, (pre_N, after_N-N_samples), mode='constant', constant_values=0)
|
||||||
antenna.Ey = np.pad(antenna.Ey, (pre_N, new_N-N_samples-pre_N), mode='constant', constant_values=0)
|
antenna.Ey = np.pad(antenna.Ey, (pre_N, after_N-N_samples), mode='constant', constant_values=0)
|
||||||
antenna.Ez = np.pad(antenna.Ez, (pre_N, new_N-N_samples-pre_N), mode='constant', constant_values=0)
|
antenna.Ez = np.pad(antenna.Ez, (pre_N, after_N-N_samples), mode='constant', constant_values=0)
|
||||||
|
|
||||||
|
if i%10 == 0:
|
||||||
|
print(f"Modified trace lengths by {pre_N},{after_N-N_samples}")
|
||||||
|
|
||||||
t0 = 0
|
t0 = 0
|
||||||
c_light = 3e8*1e-9 # m/ns
|
c_light = 3e8*1e-9 # m/ns
|
||||||
|
|
Loading…
Reference in a new issue