From cbf17ca83033437cc1bc611faec510a930fc539a Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Wed, 5 Oct 2022 18:13:10 +0200 Subject: [PATCH] figure: antenna_setup optional annotate t_d --- figures/beacon/src/four_antenna_setup.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/figures/beacon/src/four_antenna_setup.py b/figures/beacon/src/four_antenna_setup.py index 0d22719..a889b0f 100755 --- a/figures/beacon/src/four_antenna_setup.py +++ b/figures/beacon/src/four_antenna_setup.py @@ -63,7 +63,7 @@ def antenna_baselines(antennas): return combinations(antennas, 2) -def plot_four_antenna_geometry(tx, ants, extra_ant=None, ax=None, line_kwargs={}, scatter_kwargs={}, scatter_zorder=5): +def plot_four_antenna_geometry(tx, ants, extra_ant=None, ax=None, line_kwargs={}, scatter_kwargs={}, scatter_zorder=5, annotate_td=True): default_line_kwargs = dict( color='grey', lw=3, alpha=0.7) default_scatter_kwargs = dict( color='grey', s=200) @@ -88,9 +88,19 @@ def plot_four_antenna_geometry(tx, ants, extra_ant=None, ax=None, line_kwargs={} # Lines connecting Tx and ants tmp_line_kwargs = line_kwargs + tmp_line_kwargs['linestyle'] = '--' for ant in ants: ax.plot([tx.x, ant.x], [tx.y, ant.y], **tmp_line_kwargs) + if annotate_td: + annot_kwargs = dict(va='bottom', ha='center') + dx, dy = 0, 0.1 + x = (tx.x + ant.x)/2 + dx + y = (tx.y + ant.y)/2 + dy + + + ax.annotate(f'$t_{{d{ant.name}}}$', (x,y), **annot_kwargs) + # Lines due to all Antennas (including extra_ant) if extra_ant is not None: line_offset = 0.08*np.array([1,1]) @@ -111,6 +121,7 @@ def plot_four_antenna_geometry(tx, ants, extra_ant=None, ax=None, line_kwargs={} # Lines internal to ants triangle tmp_line_kwargs = line_kwargs tmp_line_kwargs['color'] = 'green' + tmp_line_kwargs['linestyle'] = '-' tmp_line_kwargs['alpha'] = 0.7 for j, ant_pair in enumerate(combinations(ants,2)): a, b = ant_pair[0], ant_pair[1]