@@ -0,0 +1,1092 @@
+#!/bin/env python3%0A%0Aimport glob%0Aimport pandas as pd%0Aimport json%0Aimport pprint%0A%0Aimport matplotlib%0Amatplotlib.use('PDF')%0Aimport matplotlib.pyplot as plt%0A%0Afrom collections import defaultdict%0A%0A%0Adef add_freq(e1, e2):%0A    for k in e2:%0A            e1%5Bk%5D += len(e2%5Bk%5D)%0A    return e1%0A%0A%0Adef analyse(files, results):%0A    for f in files:%0A        data = json.load(open(f))%0A        for e in data.values():%0A            try:%0A                freqs = e%5B'channelsurvey'%5D%5B'survey'%5D%0A            except:%0A                pass%0A            else:%0A                results = add_freq(results, freqs)%0A    return results%0A%0A%0Adef run():%0A    files = sorted(glob.glob('*.json'))%0A    results = defaultdict(int)%0A    return analyse(files, results)%0A%0A%0Adef plot(results):%0A    p_res = pd.Series(results)%0A    with plt.xkcd():%0A        ax = p_res.plot(kind='bar')%0A        fig = ax.get_figure()%0A        fig.savefig('./result.pdf')%0A%0A%0Aif __name__ == '__main__':%0A    results = run()%0A    with open('./results.json', 'w') as out:%0A        json.dump(results, out)%0A    pp = pprint.PrettyPrinter(indent=2)%0A    pp.pprint(results)%0A    plot(results)%0A

add analyse.py for channel survey