mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2026-10-17 04:52:36 +00:00
Parameterize Python plotting utilities in utils/python
This commit is contained in:
@@ -32,9 +32,8 @@ import os
|
||||
|
||||
def plotKalman(channelNr, trackResults, settings):
|
||||
|
||||
# ---------- CHANGE HERE (or pass 'fig_path' in settings):
|
||||
fig_path = settings.get('fig_path',
|
||||
'../../../PLOTS/PlotKalman')
|
||||
fig_path = settings.get('fig_path', 'plots/kalman')
|
||||
output_format = settings.get('output_format', 'png')
|
||||
|
||||
if not os.path.exists(fig_path):
|
||||
os.makedirs(fig_path)
|
||||
@@ -140,6 +139,9 @@ def plotKalman(channelNr, trackResults, settings):
|
||||
plt.savefig(os.path.join(fig_path,
|
||||
f'kalman_ch{channelNr}_PRN_'
|
||||
f'{trackResults[channelNr - 1]["PRN"][-1]}'
|
||||
f'.png'))
|
||||
if settings.get('show', True):
|
||||
plt.show()
|
||||
f'.{output_format}'))
|
||||
# Close unless it will be shown; the caller triggers a single
|
||||
# plt.show() at the end. Avoids repeated show()/close() cycles, which
|
||||
# can crash interactive matplotlib backends (e.g. macOS) on close.
|
||||
if not settings.get('show', True):
|
||||
plt.close()
|
||||
|
||||
Reference in New Issue
Block a user