src.expplot
Classes
An interface to matplotlib specialised for plotting experiments |
Functions
|
Calculates the nearest range the experiment can measure. Since only one baud |
|
Calculates the furthest range the experiment measures. This is the last range |
|
Plot phases of experiment as a single bar plot. |
|
Module Contents
- src.expplot.calc_nearest_range(tx_interval, rx_interval, baud_length, v=c)
Calculates the nearest range the experiment can measure. Since only one baud will be measured at this range, the performance at this range will be low.
- Parameters:
tx_interval (src.timeInterval.TimeInterval) – Transmit interval
rx_interval (src.timeInterval.TimeInterval) – Receive interval
baud_length (float) – baud length of experiment
v (float) – Speed of beam, default speed of light
- Returns:
Nearest range gate.
- Return type:
float
- src.expplot.calc_furthest_full_range(tx_interval, rx_interval, baud_length, v=c)
Calculates the furthest range the experiment measures. This is the last range where the receiver «sees» the whole transmit passing through.
- Parameters:
tx_interval (src.timeInterval.TimeInterval) – Transmit interval
rx_interval (src.timeInterval.TimeInterval) – Receive interval
baud_length (float) – baud length of experiment
v (float) – Speed of beam, default speed of light
- Returns:
Furthest range gate.
- Return type:
float
- src.expplot.plot_phases(ax, phaseshifts, tx_intervals, linename='phase', relative_time=False)
Plot phases of experiment as a single bar plot.
All phases are plotted on the line specified with linename
- Parameters:
ax (plt.Axes) – Axes object to plot on
phaseshifts (EventList) – List of phaseshifts
tx_intervals (TransmitIntervalList) – list of transmit intervals
linename (str) – Name of the line to plot onto. Defaults to “phase”.
relative_time (bool) – Let time axis show time relative to begin of first
- Return type:
None
transmission (True) or as given by the intervals (False), defaults to False.
- src.expplot.phaseshift_plot(subcycles)
- class src.expplot.Expplot(plot_interval, rmax=1000000.0)
An interface to matplotlib specialised for plotting experiments (transmit/receive beams)
- Parameters:
plot_interval (src.timeInterval.TimeInterval)
rmax (float)
- fig
- ax
- plot_interval
- available_colours = ['tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink',...
- cols
- get_colour(name)
Get colour for desired parameter.
Assigns a new colour if needed. There is a maximum of assignable colours since matplotlibs default colours are used. These are limited.
- Parameters:
name (str) – parameter name
- Raises:
RuntimeError – if a new colour is assigned but there is no new colour to take.
- Returns:
colour
- Return type:
str
- title(title)
Set supertitle to figure
- Parameters:
title (str) – Title string
- xlim(interval=None)
Set x axes limits.
- Parameters:
interval (Union[src.timeInterval.TimeInterval, None]) – x axes limits as a TimeInterval
interval
- add_beam(name, interval, v=c, transmit=True, **kwargs)
Plots transmit or receive beam position
- Parameters:
interval (TimeInterval) – Interval of signal being transmitted/received
v (float) – Velocity of beam, default light speed
transmit (bool) – Direction of beam. True – Transmit, False – receive, defaults to True
name (str)
v
transmit
Keyword arguments are passed further to matplotlib.
- transmit(name, interval, **kwargs)
Plots transmit beam position
- Parameters:
interval (TimeInterval) – Interval of signal being transmitted
name (str)
Keyword arguments are passed further to matplotlib.
- receive(name, interval, **kwargs)
Plots receive beam position
- Parameters:
interval (TimeInterval) – Interval of signal being received
name (str)
Keyword arguments are passed further to matplotlib.
- state(name, bar_lengths, bars_begin_at, **kwargs)
Plot setting of radar.
- Parameters:
name (str) – name of setting
bar_lengths (list or numpy array) – Lengths of bars
bars_begin_at (list or numpy array) – Position where bars begin
Other (keyword) arguments go directly to plotting function
- phase(phaseshifts, tx_intervals)
- Parameters:
phaseshifts (src.eventlist.EventList)
tx_intervals (src.timeInterval.TimeIntervalList)
- frequency(name, rx_freqs, interval, **kwargs)
Plot (receiver) frequencies
- Parameters:
rx_freqs (dict[str, FrequencyList]) – Channels with corresponding frequencies
name (str)
interval (src.timeInterval.TimeInterval)
- add_range_label(r)
Adds a label to a certain range as a minor tick
- Parameters:
r (float) – range [m]
- add_time_label(t)
Adds a label to a certain time as a minor tick
- Parameters:
t (float) – time [s]