mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2025-06-18 05:06:41 +02:00
ZH: move true_phase_diff function to lib
This commit is contained in:
parent
14a9fdb957
commit
ae66d4ff1d
2 changed files with 32 additions and 30 deletions
|
@ -53,6 +53,32 @@ def beacon_from(tx, rx, f, t=0, t0=0, c_light=3e8, radiate_rsq=True, amplitude=1
|
|||
|
||||
return sine_beacon(f, t, t0=t0, amplitude=amplitude,**kwargs)
|
||||
|
||||
def antenna_true_phase_diff(tx, antennas, freq_name, c_light=3e8):
|
||||
"""
|
||||
Determine true phases from the antenna phases.
|
||||
|
||||
This removes the geometrical phase from the antenna phase.
|
||||
"""
|
||||
if not hasattr(antennas, '__len__'):
|
||||
single_ant = True
|
||||
antennas = [antennas]
|
||||
|
||||
true_phases = np.empty( (len(antennas)) )
|
||||
for i, ant in enumerate(antennas):
|
||||
beacon_info = ant.beacon_info[freq_name]
|
||||
measured_phase = beacon_info['phase']
|
||||
f_beacon = beacon_info['freq']
|
||||
|
||||
geom_time = geometry_time(tx, ant, c_light=c_light)
|
||||
geom_phase = geom_time * 2*np.pi*f_beacon
|
||||
|
||||
print(ant.name, measured_phase, geom_phase, phase_mod(geom_phase))
|
||||
|
||||
true_phases[i] = phase_mod(phase_mod(measured_phase) - phase_mod(geom_phase) )
|
||||
|
||||
return true_phases
|
||||
|
||||
|
||||
""" Fourier """
|
||||
def ft_corr_vectors(freqs, time):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue