Skip to content

Commit 863af6c

Browse files
committed
Fix decode rate counting
1 parent 3dbda4f commit 863af6c

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

src/wsjt_all/plotter_single.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ def make_chart_single(plt, fig, axs, decodes_A, session_info):
1313
numbs = [0] * timerange_mins
1414
call_rpts = {}
1515
for d in decodes_A:
16-
call_rpts.setdefault(d['oc'],[]).append({'t':d['t'], 'rp':d['rp']})
17-
tmins = int((int(d['t']) - session_info[0])/60)
18-
if(tmins>=0 and tmins < timerange_mins):
16+
t = d['t'] - session_info[0]
17+
if(t>=0 and t < 60*timerange_mins):
18+
call_rpts.setdefault(d['oc'],[]).append({'t':t, 'rp':d['rp']})
19+
tmins = int(t/60)
1920
numbs[tmins] += 1
2021
xc = [x + 0.5 for x in range(0,timerange_mins)] # marker at centre of minute bin
2122
axs[0].plot(xc, numbs, marker = 'o', alpha = 0.9, lw = 0.5)
@@ -30,8 +31,8 @@ def make_chart_single(plt, fig, axs, decodes_A, session_info):
3031
xc, yc = [], []
3132
cols.append(hash_color(c, plt.cm.tab20))
3233
for rpt in call_rpts[c]:
33-
if(rpt['t']>= session_info[0] and rpt['t']<= session_info[1]):
34-
xc.append((rpt['t'] - session_info[0]) / 60)
34+
if(rpt['t']>= 0 and rpt['t']<= 60*timerange_mins):
35+
xc.append(rpt['t'] / 60)
3536
yc.append(rpt['rp'])
3637
axs[1].plot(xc, yc, label = c, marker ="o", color = cols[i], alpha = 0.9, lw = 0.2)
3738

src/wsjt_all/prog_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import configparser
22
import os
3-
from .plotter_dual import plot_all_historic_dual, make_chart_dual
3+
from .plotter_dual import plot_all_historic_dual, plot_live_dual
44
from .plotter_single import plot_all_historic_single, plot_live_single
55

66
def check_config():

tests/plot_test.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
import matplotlib.pyplot as plt
22

3+
def count_rate():
4+
dectimes=[-30,-30,-30,0,0,0,0,0,15,15,15,15, 120,120,120, 240,240,240,240, 480,480]
5+
6+
print("Plotting number of reports")
7+
timerange_mins = int((600 - 0) / 60)
8+
numbs = [0] * timerange_mins
9+
call_rpts = {}
10+
for dt in dectimes:
11+
if(dt>=0 and dt < 60*timerange_mins):
12+
tmins = int(dt/60)
13+
print(tmins)
14+
numbs[tmins] += 1
15+
xc = [x + 0.5 for x in range(0,timerange_mins)] # marker at centre of minute bin
16+
axs[0].plot(xc, numbs, marker = 'o', alpha = 0.9, lw = 0.5)
17+
18+
19+
320
def venn(ax, ns):
421
x1 = n[0]/sum(ns)
522
x2 = (sum(ns)-ns[2])/sum(ns)
@@ -17,8 +34,8 @@ def venn(ax, ns):
1734
fig.suptitle(f"Session: 1st line\n2nd line")
1835

1936
n=[30,30,30] # A, AB, B
20-
venn(axs[0],n)
21-
37+
#venn(axs[0],n)
38+
count_rate()
2239
axs[1].set_title("Number of decodes of each callsign in session for A and B")
2340
axs[1].set_xlabel("Number of decodes in all.txt A")
2441
axs[1].set_ylabel("Number of decodes in all.txt B")

tests/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
from wsjt_all import *
55

6-
wsjt_all_live()
6+
wsjt_all_ab_live()
77

tests/wsjt_all.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ allB = C:\Users\drala\AppData\Local\WSJT-X - AltAB\all.txt
44

55
[settings]
66
session_guard_seconds = 300
7-
live_plot_window_seconds = 600
7+
live_plot_window_seconds = 300
88
show_best_snrs_only = N

0 commit comments

Comments
 (0)