Commit b2e5864fc469da8688e70361999ec929c78613b1
1 parent
2e009c12df
Exists in
master
allanplot: add relative ADEV option `-R`
Showing 1 changed file with 12 additions and 1 deletions Side-by-side Diff
allanplot.py
... | ... | @@ -39,6 +39,12 @@ |
39 | 39 | default=RATE, |
40 | 40 | help='Time rate in seconds (default '+str(RATE)+')') |
41 | 41 | |
42 | + parser.add_argument('-R', | |
43 | + action='store_true', | |
44 | + dest='rel', | |
45 | + default=False, | |
46 | + help='Relative ADev') | |
47 | + | |
42 | 48 | args = parser.parse_args() |
43 | 49 | return args |
44 | 50 | |
... | ... | @@ -56,6 +62,8 @@ |
56 | 62 | columns = map(int, args.columns) |
57 | 63 | # rate |
58 | 64 | rate = int(args.rate) |
65 | + # rel | |
66 | + rel = bool(args.rel) | |
59 | 67 | |
60 | 68 | try: |
61 | 69 | list_files = [] |
... | ... | @@ -86,7 +94,10 @@ |
86 | 94 | g.ylabel('Adev') |
87 | 95 | |
88 | 96 | for i in columns: |
89 | - (tau2, ad, ade, adn) = allantools.adev(data[:,i], rate=rate, data_type="freq", taus='decade') | |
97 | + if rel: | |
98 | + (tau2, ad, ade, adn) = allantools.adev(data[:,i]/data[:,i].mean(), rate=rate, data_type="freq", taus='decade') | |
99 | + else: | |
100 | + (tau2, ad, ade, adn) = allantools.adev(data[:,i], rate=rate, data_type="freq", taus='decade') | |
90 | 101 | g.replot(Gnuplot.Data(tau2, ad, ade, with_='yerrorbars', title='%s : %s'%(name, str(i)))) |
91 | 102 | |
92 | 103 | except Exception as ex: |